; Script generated by the Inno Setup Script Wizard. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES! [Setup] ; NOTE: The value of AppId uniquely identifies this application. ; Do not use the same AppId value in installers for other applications. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.) AppId={{E2D7B543-D5B9-4C86-834D-9B718E26369D} AppName=OpenNI (Kinect) plugin for Scol AppVerName=OpenNI (Kinect) plugin for Scol 1.1 AppPublisher=I-Maginer AppPublisherURL=http://www.openspace3d.com AppSupportURL=http://www.openspace3d.com AppUpdatesURL=http://www.openspace3d.com DefaultDirName={code:GetScolInstallDir} DefaultGroupName=OpenSpace3D OutputDir=release OutputBaseFilename=scol_kinect SetupIconFile=../../install_scol_voyager/scol.ico Compression=lzma SolidCompression=true UninstallDisplayIcon={app}\scol.ico InternalCompressLevel=max VersionInfoVersion=1.1 VersionInfoCompany=I-Maginer VersionInfoDescription=Kinect plugin for Scol VersionInfoCopyright=I-Maginer 2011 MinVersion=0,5.01.2600 AppCopyright=I-Maginer 2011 DisableProgramGroupPage=false UsePreviousAppDir=false AppendDefaultGroupName=true InfoBeforeFile=readme.txt [Languages] Name: english; MessagesFile: compiler:Default.isl Name: french; MessagesFile: compiler:Languages\French.isl [Tasks] ;TODO TEST if OS3D is present: [Files] ; NOTE: Don't use "Flags: ignoreversion" on any shared system files Source: redist\*; DestDir: {tmp}\kinect_redist\; Flags: ignoreversion ; TODO OS3D plugIT and demos: Source: ..\..\..\scol_sdk\bin\Release\Plugins\OpenNiSCOL.dll; DestDir: {app}\Plugins; Flags: ignoreversion Source: ..\..\..\scol_applications\openspace3d\os3dplugins\input\kinectdevice\*; DestDir: {code:GetScolLockedDir}\tools\os3dplugins\input\kinectdevice; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn Source: ..\..\..\scol_applications\openspace3d\os3dplugins\input\kinectuser\*; DestDir: {code:GetScolLockedDir}\tools\os3dplugins\input\kinectuser; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn Source: ..\..\..\scol_applications\openspace3d\demos\kinectdemo\*; DestDir: {code:GetScolUserDir}\demos\kinectdemo; Flags: ignoreversion recursesubdirs createallsubdirs; Excludes: .svn ; Source: ..\..\..\..\scol_applications\scolvoyager\locked\*; DestDir: {app}\Partition_LockedApp\locked; Flags: ignoreversion createallsubdirs overwritereadonly recursesubdirs; Excludes: .svn [Icons] Name: {group}\Demos\K'Andy nect; Filename: {code:GetScolUserDir}\demos\kinectdemo\kandynect.scol; IconIndex: 0 Name: {group}\Demos\Kinect skeleton; Filename: {code:GetScolUserDir}\demos\kinectdemo\skeleton.scol; IconIndex: 0 Name: {group}\Demos\Kinect control; Filename: {code:GetScolUserDir}\demos\kinectdemo\kinect_control.scol; IconIndex: 0 Name: Scol Voy@ger\{cm:UninstallProgram,Kinect plugin}; Filename: {uninstallexe} [Run] Filename: {tmp}\scolplug.exe; Parameters: /VERYSILENT; Check: VoyagerIsNeeded; StatusMsg: Installing Scol Voy@ger... Filename: msiexec; Parameters: /i {tmp}\kinect_redist\OpenNI-Win32-1.3.2.3-Redist.msi; StatusMsg: Installing OpenNI redist... Filename: msiexec; Parameters: /i {tmp}\kinect_redist\SensorKinect-Win-OpenSource32-5.0.3.4.msi /qn; StatusMsg: Installing PrimeSense Kinect driver... Filename: msiexec; Parameters: /i {tmp}\kinect_redist\NITE-Win32-1.4.1.2-Redist.msi; StatusMsg: Installing PrimeSense Nite redist... [Registry] [CustomMessages] french.NoScolInstalled=L'installation de Scol Voy@ger n'a pas été trouvée. Installez le Scol Voy@ger depuis www.scolring.org puis réessayez. english.NoScolInstalled=The Scol Voy@ger installation can not be found. Install the Scol Voy@ger from www.scolring.org and retry. french.BadScolInstalled=La version trouvée du Scol Voy@ger est obselète. Installez la dernière version du Scol Voy@ger depuis www.scolring.org puis réessayez. english.BadScolInstalled=You must install the last version of Scol Voy@ger from www.scolring.org. [Code] //use http://www.sherlocksoftware.org/page.php?id=51 for http download #include ReadReg(HKEY_LOCAL_MACHINE,'Software\Sherlock Software\InnoTools\Downloader','ScriptPath','') #include "../../common/common_type.iss" var InternalMsgs: array of TInternalMsg; var NeedVoyager: Boolean; var ScolUserPartition: String; var ScolLockedPartition: String; #include "../../common/common_code.iss" function VoyagerIsNeeded(): Boolean; begin Result := NeedVoyager; end; function GetScolUserDir(Default: String): String; begin Result := ScolUserPartition; end; function GetScolLockedDir(Default: String): String; begin Result := ScolLockedPartition; end; /////////////////////////////// // Scol install directory function GetScolInstallDir(Default: String): String; var Value: String; begin Value := GetScolDir(ExpandConstant('{pf}') + '\Scol Voyager'); if (CheckScolVer(Value) = False) then begin NeedVoyager := True; end else begin NeedVoyager := False; end; ScolUserPartition := GetScolUserPartitionDir(Value, ExpandConstant('{userdocs}') + '\Scol Voyager\Partition_LocalUsr'); ScolLockedPartition := GetScolLockedPartitionDir(Value, Value + '\Partition_LockedApp'); Result := Value; end; var ResultCode: Integer; procedure CurStepChanged(CurStep: TSetupStep); var Uninstall: String; UsmIni: String; UsmFile: String; ArrUsmIni: array of String; begin if (CurStep = ssInstall) then begin // Kill Scol Voyager and wait for it to terminate if Exec(ExpandConstant('tskill'), 'scol', '', SW_HIDE, ewNoWait, ResultCode) OR Exec(ExpandConstant('taskkill'), '/IM ' + GetScolExe() + ' /F', '', SW_HIDE, ewNoWait, ResultCode) then begin // handle success if necessary; ResultCode contains the exit code //MsgBox('ok', mbInformation, MB_OK); end else begin // handle failure if necessary; ResultCode contains the error code //MsgBox('pas ok', mbInformation, MB_OK); end; if RegQueryStringValue(HKLM, 'Software\Microsoft\Windows\CurrentVersion\Uninstall\{E2D7B543-D5B9-4C86-834D-9B718E26369D}_is1', 'UninstallString', Uninstall) then begin Exec(RemoveQuotes(Uninstall), ' /SILENT', '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode); end; end else begin if (CurStep = ssDone) then begin UsmFile := ExpandConstant('{app}\usm.ini'); // update usm.ini LoadStringFromFile(UsmFile, UsmIni); if FileExists (UsmFile)= true then begin FileCopy (UsmFile, ExpandConstant('{app}\usm.bak'), false); end; // load file in array SetArrayLength(ArrUsmIni, 0); Strings2Array(UsmIni, ArrUsmIni); if InstallPluginDll(ArrUsmIni, 'OpenNiSCOL.dll', '') then begin SaveStringsToFile(UsmFile, ArrUsmIni, false); //MsgBox(UsmFile, mbInformation, MB_OK); end else begin //MsgBox('KO', mbInformation, MB_OK); end; end; end; end; procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep); begin if (CurUninstallStep = usUninstall) then begin // Kill Scol Voyager and wait for it to terminate if Exec(ExpandConstant('tskill'), 'scol', '', SW_HIDE, ewNoWait, ResultCode) OR Exec(ExpandConstant('taskkill'), '/IM ' + GetScolExe() + ' /F', '', SW_HIDE, ewNoWait, ResultCode) then begin // handle success if necessary; ResultCode contains the exit code //MsgBox('ok', mbInformation, MB_OK); end else begin // handle failure if necessary; ResultCode contains the error code //MsgBox('pas ok', mbInformation, MB_OK); end; end; end; procedure InitializeWizard(); begin if NeedVoyager = True then begin ITD_Init(); ITD_AddFile('http://www.scolring.org/rsc/scol_plugin.exe', ExpandConstant('{tmp}\scolplug.exe')); ITD_AddMirror('http://www.openspace3d.com/rsc/scol_plugin.exe', ExpandConstant('{tmp}\scolplug.exe')); ITD_DownloadAfter(wpReady); end; end;