Переглянути джерело

Improve base examples some more.

Martijn Laan 7 роки тому
батько
коміт
c7a2690e77
4 змінених файлів з 25 додано та 1 видалено
  1. 3 0
      Examples/Example1.iss
  2. 3 0
      Examples/Example2.iss
  3. 16 1
      Examples/Example3.iss
  4. 3 0
      Examples/UnicodeExample1.iss

+ 3 - 0
Examples/Example1.iss

@@ -12,6 +12,9 @@ UninstallDisplayIcon={app}\MyProg.exe
 Compression=lzma2
 SolidCompression=yes
 OutputDir=userdocs:Inno Setup Examples Output
+; This script works in both administrative and non administrative install mode.
+; Remove the next line to run in administrative install mode.  
+PrivilegesRequired=lowest
 
 [Files]
 Source: "MyProg.exe"; DestDir: "{app}"

+ 3 - 0
Examples/Example2.iss

@@ -15,6 +15,9 @@ UninstallDisplayIcon={app}\MyProg.exe
 Compression=lzma2
 SolidCompression=yes
 OutputDir=userdocs:Inno Setup Examples Output
+; This script works in both administrative and non administrative install mode.
+; Remove the next line to run in administrative install mode.  
+PrivilegesRequired=lowest
 
 [Files]
 Source: "MyProg.exe"; DestDir: "{app}"

+ 16 - 1
Examples/Example3.iss

@@ -13,6 +13,10 @@ Compression=lzma2
 SolidCompression=yes
 OutputDir=userdocs:Inno Setup Examples Output
 ChangesAssociations=yes
+UserInfoPage=yes
+; This script works in both administrative and non administrative install mode.
+; Remove the next line to run in administrative install mode.  
+PrivilegesRequired=lowest
 
 [Files]
 Source: "MyProg.exe"; DestDir: "{app}"
@@ -45,4 +49,15 @@ Root: HKA; Subkey: "Software\Classes\MyProgramFile.myp\shell\open\command"; Valu
 ; is only possible in administrative install mode.
 Root: HKLM; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty; Check: IsAdminInstallMode
 Root: HKLM; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekey; Check: IsAdminInstallMode
-Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"; Check: IsAdminInstallMode
+Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"; Check: IsAdminInstallMode
+; User specific settings should always be written to HKCU, which should only
+; be done in non administrative install mode.
+Root: HKCU; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "UserName"; ValueData: "{userinfoname}"; Check: not IsAdminInstallMode
+Root: HKCU; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "UserOrganization"; ValueData: "{userinfoorg}"; Check: not IsAdminInstallMode
+
+[Code]
+function ShouldSkipPage(PageID: Integer): Boolean;
+begin
+  // User specific pages should be skipped in administrative install mode
+  Result := IsAdminInstallMode and (PageID = wpUserInfo);
+end;

+ 3 - 0
Examples/UnicodeExample1.iss

@@ -12,6 +12,9 @@ UninstallDisplayIcon={app}\ƃoɹdʎɯ.exe
 Compression=lzma2
 SolidCompression=yes
 OutputDir=userdocs:Inno Setup Examples Output
+; This script works in both administrative and non administrative install mode.
+; Remove the next line to run in administrative install mode.  
+PrivilegesRequired=lowest
 
 [Files]
 Source: "MyProg.exe"; DestDir: "{app}"; DestName: "ƃoɹdʎɯ.exe"