oh-my-posh/packages/inno/oh-my-posh.iss

51 lines
1.7 KiB
Plaintext
Raw Normal View History

2021-01-28 12:53:45 -08:00
[Setup]
AppName=Oh My Posh
2021-01-28 12:53:45 -08:00
AppVersion=<VERSION>
VersionInfoVersion=<VERSION>
2021-01-28 12:53:45 -08:00
DefaultDirName={autopf}\oh-my-posh
DefaultGroupName=Oh My Posh
2021-01-28 12:53:45 -08:00
AppPublisher=Jan De Dobbeleer
AppPublisherURL=https://ohmyposh.dev
2021-02-15 23:36:37 -08:00
AppSupportURL=https://github.com/JanDeDobbeleer/oh-my-posh/issues
2021-01-28 12:53:45 -08:00
LicenseFile="bin\COPYING.txt"
OutputBaseFilename=install
UninstallDisplayIcon={app}\bin\oh-my-posh.exe
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
ChangesEnvironment=yes
SignTool=signtool
SignedUninstaller=yes
CloseApplications=no
2021-01-28 12:53:45 -08:00
[Files]
Source: "bin\oh-my-posh.exe"; DestDir: "{app}\bin"
2021-01-28 12:53:45 -08:00
Source: "bin\themes\*"; DestDir: "{app}\themes"
[Registry]
Root: "HKA"; Subkey: "{code:GetEnvironmentKey}"; ValueType: expandsz; ValueName: "Path"; ValueData: "{olddata};{app}\bin"; Check: NeedsAddPathHKA(ExpandConstant('{app}\bin'))
Root: "HKA"; Subkey: "{code:GetEnvironmentKey}"; ValueType: string; ValueName: "POSH_THEMES_PATH"; ValueData: {app}\themes; Flags: preservestringtype
Root: "HKA"; Subkey: "{code:GetEnvironmentKey}"; ValueType: string; ValueName: "POSH_INSTALLER"; ValueData: {param:installer|manual}; Flags: preservestringtype
2021-01-28 12:53:45 -08:00
[Code]
function GetEnvironmentKey(Param: string): string;
2021-01-28 12:53:45 -08:00
begin
if IsAdminInstallMode then
Result := 'System\CurrentControlSet\Control\Session Manager\Environment'
else
Result := 'Environment';
2021-01-28 12:53:45 -08:00
end;
function NeedsAddPathHKA(Param: string): boolean;
var
OrigPath: string;
begin
if not RegQueryStringValue(HKA, GetEnvironmentKey(''), 'Path', OrigPath)
then begin
Result := True;
exit;
end;
// look for the path with leading and trailing semicolon
// Pos() returns 0 if not found
Result := Pos(';' + Param + ';', ';' + OrigPath + ';') = 0;
2021-01-28 12:53:45 -08:00
end;