oh-my-posh/packages/inno/oh-my-posh.iss
Jan De Dobbeleer 02e819fc00
Some checks are pending
Code QL / code-ql (push) Waiting to run
Release / changelog (push) Waiting to run
Release / artifacts (push) Blocked by required conditions
fix(inno): sign installer with signtool
this effectively disables signing the uninstaller
as somehow inno setup doesn't forward environment
variables to the subshell used to run signtool. As
we can't authenticate using environment variables
that way, we also can't sign with our new
certificate. Future thought will need to be given.
2024-11-16 20:18:33 +01:00

49 lines
1.7 KiB
Plaintext

[Setup]
AppName=Oh My Posh
AppVersion=<VERSION>
VersionInfoVersion=<VERSION>
DefaultDirName={autopf}\oh-my-posh
DefaultGroupName=Oh My Posh
AppPublisher=Jan De Dobbeleer
AppPublisherURL=https://ohmyposh.dev
AppSupportURL=https://github.com/JanDeDobbeleer/oh-my-posh/issues
LicenseFile="bin\COPYING.txt"
OutputBaseFilename=install
UninstallDisplayIcon={app}\bin\oh-my-posh.exe
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
ChangesEnvironment=yes
CloseApplications=no
[Files]
Source: "bin\oh-my-posh.exe"; DestDir: "{app}\bin"
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
[Code]
function GetEnvironmentKey(Param: string): string;
begin
if IsAdminInstallMode then
Result := 'System\CurrentControlSet\Control\Session Manager\Environment'
else
Result := 'Environment';
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;
end;