R-Studio

Tested with opsi 4.0.3
requiredWinstVersion >= 4.10.8.6
Tested with R-Studio 0.98.501
By — adlerweb 2014/02/27 14:43

Files can be downloaded at https://www.rstudio.com/ide/download/desktop

Requires R to be installed

Tree:
setup.ins
uninstall.ins
delsub.ins

setup.ins

[Actions]
requiredWinstVersion >= "4.10.8.6"
 
DefVar $ProductId$
DefVar $MinimumSpace$
DefVar $UninstallProgram$
 
Set $ProductId$       = "r-studio"
Set $MinimumSpace$    = "250 MB"
 
 
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
if not(HasMinimumSpace ("%SystemDrive%", $MinimumSpace$))
	LogError "Not enough space on %SystemDrive%, " + $MinimumSpace$ + " on drive %SystemDrive% needed for " + $ProductId$
	isFatalError
	; Stop process and set installation status to failed
else
	if FileExists("%ScriptPath%\delsub.ins")
		comment "start uninstall"
		sub "%ScriptPath%\delsub.ins"
	endif
 
	comment "installing"
 
	comment "Start setup program"
	Winbatch_install
 
endif
 
[Winbatch_install]
 "%ScriptPath%\RStudio-0.98.501.exe" /S
 

uninstall.ins

[Actions]
DefVar $ProductId$
DefVar $UninstallProgram$
 
Set $ProductId$ = "r-studio"
 
ShowBitmap "%ScriptPath%\" + $ProductId$ + ".png" $ProductId$
 
if FileExists("%ScriptPath%\delsub.ins")
	comment "start uninstall"
	sub "%ScriptPath%\delsub.ins"
endif

delsub.ins

Set $UninstallProgram$ = "%ProgramFilesSysnativeDir%\RStudio\Uninstall.exe"
if FileExists($UninstallProgram$)
	Message "Found "+$ProductId$+" => uninstalling first"
	Winbatch_uninstall
endif
 
[Winbatch_uninstall]
 "$UninstallProgram$" /S