isportable.iss 817 B

12345678910111213141516171819202122232425262728293031323334
  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. end;
  20. <event('InitializeWizard')>
  21. procedure IsPortableInitializeWizard;
  22. begin
  23. if PortableCheck then
  24. WizardForm.NoIconsCheck.Checked := True;
  25. end;
  26. <event('ShouldSkipPage')>
  27. function IsPortableShouldSkipPage(PageID: Integer): Boolean;
  28. begin
  29. Result := (PageID = wpSelectProgramGroup) and PortableCheck;
  30. end;