Debian Codegraph @

misc/DisplayCAL-Setup-0install-per-user.iss

raw
1 ; Script generated by the Inno Setup Script Wizard.
2 ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
3
4 #include ReadReg(HKEY_LOCAL_MACHINE,'Software\Sherlock Software\InnoTools\Downloader','ScriptPath','')
5
6 [Setup]
7 ; NOTE: The value of AppId uniquely identifies this application.
8 ; Do not use the same AppId value in installers for other applications.
9 ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
10 AppID={{4714199A-0D66-4E69-97FF-7B54BFF80B88}
11 AppCopyright=%(AppCopyright)s
12 AppName=%(AppName)s
13 AppPublisher=%(AppPublisher)s
14 AppPublisherURL=%(AppPublisherURL)s
15 AppReadmeFile=%(URL)s
16 AppSupportURL=%(AppSupportURL)s
17 AppUpdatesURL=%(AppUpdatesURL)s
18 ArchitecturesInstallIn64BitMode=x64
19 ArchitecturesAllowed=x64
20 DefaultDirName={userpf}\%(AppName)s
21 DefaultGroupName=%(AppName)s
22 LicenseFile=..\LICENSE.txt
23 OutputDir=.
24 OutputBaseFilename=%(AppName)s-0install-Setup-per-user
25 SetupIconFile=..\%(AppName)s\theme\icons\%(AppName)s.ico
26 Compression=lzma/Max
27 SolidCompression=true
28 VersionInfoVersion=%(VersionInfoVersion)s
29 VersionInfoDescription=%(AppName)s Setup
30 VersionInfoTextVersion=0install
31 WizardImageFile=..\misc\media\install.bmp
32 WizardSmallImageFile=..\misc\media\icon-install.bmp
33 AppVersion=0install
34 UninstallDisplayName={cm:UninstallProgram,%(AppName)s}
35 UninstallDisplayIcon={app}\%(AppName)s-uninstall.ico
36 AlwaysShowComponentsList=false
37 ShowLanguageDialog=auto
38 MinVersion=0,6.1.2600
39 DisableDirPage=yes
40 UsePreviousGroup=False
41 DisableProgramGroupPage=yes
42 PrivilegesRequired=lowest
43 SignTool=sign.cmd
44 SignedUninstaller=yes
45
46 [Languages]
47 Name: english; MessagesFile: ..\misc\InnoSetup\v5\Default.isl;
48 Name: french; MessagesFile: ..\misc\InnoSetup\v5\Languages\French.isl;
49 Name: german; MessagesFile: ..\misc\InnoSetup\v5\Languages\German.isl;
50 Name: italian; MessagesFile: ..\misc\InnoSetup\v5\Languages\Italian.isl;
51 Name: spanish; MessagesFile: ..\misc\InnoSetup\v5\Languages\Spanish.isl;
52
53 [Files]
54 Source: ..\%(AppName)s\theme\icons\%(AppName)s-uninstall.ico; DestDir: {app};
55
56 [Icons]
57 Name: {group}\{cm:SelectVersion}; Filename: {reg:HKCU\Software\Zero Install,InstallLocation|{reg:HKLM\Software\Zero Install,InstallLocation}}\0install-win.exe; Parameters: "run --refresh --customize --no-wait %(HTTPURL)s0install/%(AppName)s.xml";
58 Name: {group}\{cm:ChangeIntegration}; Filename: {reg:HKCU\Software\Zero Install,InstallLocation|{reg:HKLM\Software\Zero Install,InstallLocation}}\0install-win.exe; Parameters: "integrate %(HTTPURL)s0install/%(AppName)s.xml";
59 Name: {group}\{cm:UninstallProgram,%(AppName)s}; Filename: {uninstallexe}; IconFilename: {app}\%(AppName)s-uninstall.ico;
60 Name: {group}\LICENSE; Filename: %(URL)sLICENSE.txt;
61 Name: {group}\README; Filename: %(URL)s;
62 Name: {userstartup}\%(AppName)s Profile Loader; Filename: {reg:HKCU\Software\Zero Install,InstallLocation|{reg:HKLM\Software\Zero Install,InstallLocation}}\0install-win.exe; Parameters: "run --batch --no-wait --offline --command=run-apply-profiles %(HTTPURL)s0install/%(AppName)s.xml";
63
64 [Run]
65 Filename: {reg:HKCU\Software\Zero Install,InstallLocation|{reg:HKLM\Software\Zero Install,InstallLocation}}\0install-win.exe; Parameters: "integrate --refresh %(HTTPURL)s0install/%(AppName)s.xml"; Description: {cm:LaunchProgram,%(AppName)s}; Flags: runasoriginaluser
66 Filename: %(URL)s; Description: {code:Get_RunEntryShellExec_Message|README}; Flags: nowait postinstall shellexec skipifsilent;
67 Filename: {reg:HKCU\Software\Zero Install,InstallLocation|{reg:HKLM\Software\Zero Install,InstallLocation}}\0install-win.exe; Parameters: "run %(HTTPURL)s0install/%(AppName)s.xml"; Description: {cm:LaunchProgram,%(AppName)s}; Flags: nowait postinstall skipifsilent
68 Filename: {reg:HKCU\Software\Zero Install,InstallLocation|{reg:HKLM\Software\Zero Install,InstallLocation}}\0install-win.exe; Parameters: "run --batch --no-wait --command=run-apply-profiles %(HTTPURL)s0install/%(AppName)s.xml";
69 ; Filename: {reg:HKCU\Software\Zero Install,InstallLocation|{reg:HKLM\Software\Zero Install,InstallLocation}}\0install-win.exe; Parameters: "integrate --add=auto-start --batch %(HTTPURL)s0install/%(AppName)s.xml"; Description: {cm:LaunchProgram,%(AppName)s}; Flags: runasoriginaluser
70
71 [Code]
72 function Get_RunEntryShellExec_Message(Value: string): string;
73 begin
74 Result := FmtMessage(SetupMessage(msgRunEntryShellExec), [Value]);
75 end;
76
77 function Get_UninstallString(AppId: string): string;
78 var
79 UninstallString: string;
80 begin
81 if not RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + AppId + '_is1', 'UninstallString', UninstallString) and
82 not RegQueryStringValue(HKLM, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\' + AppId + '_is1', 'UninstallString', UninstallString) and
83 not RegQueryStringValue(HKCU, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\' + AppId + '_is1', 'UninstallString', UninstallString) then
84 RegQueryStringValue(HKCU, 'SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\' + AppId + '_is1', 'UninstallString', UninstallString);
85 Result := RemoveQuotes(UninstallString);
86 end;
87
88 function Get_ZeroInstall_InstallLocation: string;
89 begin
90 if not RegQueryStringValue(HKLM, 'SOFTWARE\Zero Install', 'InstallLocation', Result) then
91 RegQueryStringValue(HKCU, 'SOFTWARE\Zero Install', 'InstallLocation', Result);
92 end;
93
94 function Get_ZeroInstall_Exe: string;
95 begin
96 Result := Get_ZeroInstall_InstallLocation() + '\0install-win.exe';
97 end;
98
99 function ZeroInstall_IsInstalled: boolean;
100 var
101 ExePath: string;
102 begin
103 ExePath := Get_ZeroInstall_Exe();
104 Result := (ExePath <> '') and FileExists(ExePath);
105 end;
106
107 procedure InitializeWizard();
108 begin
109 if not ZeroInstall_IsInstalled() then begin
110 ITD_Init;
111 ITD_AddFile('http://0install.de/files/zero-install-per-user.exe', ExpandConstant('{tmp}\zero-install-per-user.exe'));
112 ITD_DownloadAfter(wpReady);
113 end;
114 end;
115
116 procedure CurStepChanged(CurStep: TSetupStep);
117 var
118 ErrorCode: integer;
119 ZeroInstall: string;
120 begin
121 if CurStep=ssInstall then begin
122 if not ZeroInstall_IsInstalled() then begin
123 if not Exec(ExpandConstant('{tmp}\zero-install-per-user.exe'), 'maintenance deploy', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode) then
124 SuppressibleMsgBox(SysErrorMessage(ErrorCode), mbCriticalError, MB_OK, MB_OK);
125 if not ZeroInstall_IsInstalled() then
126 Abort();
127 end;
128 end;
129 end;
130
131 procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
132 var
133 ErrorCode: integer;
134 ZeroInstall: string;
135 UninstallString: string;
136 begin
137 if CurUninstallStep=usUninstall then begin
138 if ZeroInstall_IsInstalled() then begin
139 ZeroInstall := Get_ZeroInstall_Exe();
140 if not Exec(ZeroInstall, 'remove --batch %(HTTPURL)s0install/%(AppName)s.xml', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode) then
141 SuppressibleMsgBox(SysErrorMessage(ErrorCode), mbError, MB_OK, MB_OK);
142 end;
143 end;
144 if CurUninstallStep=usDone then begin
145 if ZeroInstall_IsInstalled() then begin
146 UninstallString := Get_UninstallString('Zero Install');
147 if (UninstallString <> '') and (SuppressibleMsgBox(FmtMessage(CustomMessage('AskRemove'), ['Zero Install']), mbConfirmation, MB_YESNO, IDNO) = IDYES) then
148 Exec(UninstallString, '', '', SW_SHOW, ewNoWait, ErrorCode);
149 end;
150 end;
151 end;