isportable.iss 890 B

12345678910111213141516171819202122232425262728293031323334353637
  1. // -- IsPortable.iss --
  2. // Include file with support functions for portable mode
  3. //
  4. [Setup]
  5. UsePreviousAppDir=not PortableCheck
  6. Uninstallable=not PortableCheck
  7. [Code]
  8. function PortableCheck: Boolean;
  9. begin
  10. Result := ExpandConstant('{param:portable|0}') = '1';
  11. end;
  12. function GetDefaultDirName(Param: String): String;
  13. begin
  14. if PortableCheck then
  15. Result := '{autodesktop}'
  16. else
  17. Result := '{autopf}';
  18. Result := ExpandConstant(AddBackslash(Result) + Param);
  19. if PortableCheck then
  20. Result := Result + '{#spacebit}';
  21. end;
  22. <event('InitializeWizard')>
  23. procedure IsPortableInitializeWizard;
  24. begin
  25. if PortableCheck then
  26. WizardForm.NoIconsCheck.Checked := True;
  27. end;
  28. <event('ShouldSkipPage')>
  29. function IsPortableShouldSkipPage(PageID: Integer): Boolean;
  30. begin
  31. Result := (PageID = wpSelectProgramGroup) and PortableCheck;
  32. end;
  33. [/Code]