Example3.iss 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. ; -- Example3.iss --
  2. ; Same as Example1.iss, but creates some registry entries too and allows the end
  3. ; use to choose the install mode (administrative or non administrative).
  4. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
  5. [Setup]
  6. AppName=My Program
  7. AppVersion=1.5
  8. WizardStyle=modern
  9. DefaultDirName={autopf}\My Program
  10. DefaultGroupName=My Program
  11. UninstallDisplayIcon={app}\MyProg.exe
  12. Compression=lzma2
  13. SolidCompression=yes
  14. OutputDir=userdocs:Inno Setup Examples Output
  15. ChangesAssociations=yes
  16. UserInfoPage=yes
  17. PrivilegesRequiredOverridesAllowed=dialog
  18. [Files]
  19. Source: "MyProg.exe"; DestDir: "{app}"
  20. Source: "MyProg.chm"; DestDir: "{app}"
  21. Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
  22. [Icons]
  23. Name: "{group}\My Program"; Filename: "{app}\MyProg.exe"
  24. ; NOTE: Most apps do not need registry entries to be pre-created. If you
  25. ; don't know what the registry is or if you need to use it, then chances are
  26. ; you don't need a [Registry] section.
  27. [Registry]
  28. ; Create "Software\My Company\My Program" keys under CURRENT_USER or
  29. ; LOCAL_MACHINE depending on administrative or non administrative install
  30. ; mode. The flags tell it to always delete the "My Program" key upon
  31. ; uninstall, and delete the "My Company" key if there is nothing left in it.
  32. Root: HKA; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty
  33. Root: HKA; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekey
  34. Root: HKA; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "Language"; ValueData: "{language}"
  35. ; Associate .myp files with My Program (requires ChangesAssociations=yes)
  36. Root: HKA; Subkey: "Software\Classes\.myp"; ValueType: string; ValueName: ""; ValueData: "MyProgramFile.myp"; Flags: uninsdeletevalue
  37. Root: HKA; Subkey: "Software\Classes\.myp\OpenWithProgids"; ValueType: string; ValueName: "MyProgramFile.myp"; ValueData: ""; Flags: uninsdeletevalue
  38. Root: HKA; Subkey: "Software\Classes\MyProgramFile.myp"; ValueType: string; ValueName: ""; ValueData: "My Program File"; Flags: uninsdeletekey
  39. Root: HKA; Subkey: "Software\Classes\MyProgramFile.myp\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\MyProg.exe,0"
  40. Root: HKA; Subkey: "Software\Classes\MyProgramFile.myp\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\MyProg.exe"" ""%1"""
  41. ; HKA (and HKCU) should only be used for settings which are compatible with
  42. ; roaming profiles so settings like paths should be written to HKLM, which
  43. ; is only possible in administrative install mode.
  44. Root: HKLM; Subkey: "Software\My Company"; Flags: uninsdeletekeyifempty; Check: IsAdminInstallMode
  45. Root: HKLM; Subkey: "Software\My Company\My Program"; Flags: uninsdeletekey; Check: IsAdminInstallMode
  46. Root: HKLM; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "InstallPath"; ValueData: "{app}"; Check: IsAdminInstallMode
  47. ; User specific settings should always be written to HKCU, which should only
  48. ; be done in non administrative install mode.
  49. Root: HKCU; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "UserName"; ValueData: "{userinfoname}"; Check: not IsAdminInstallMode
  50. Root: HKCU; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "UserOrganization"; ValueData: "{userinfoorg}"; Check: not IsAdminInstallMode
  51. [Code]
  52. function ShouldSkipPage(PageID: Integer): Boolean;
  53. begin
  54. // User specific pages should be skipped in administrative install mode
  55. Result := IsAdminInstallMode and (PageID = wpUserInfo);
  56. end;