isportable.iss 876 B

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