added new inno setup config

This commit is contained in:
Shreyas Zare
2021-03-13 13:31:33 +05:30
parent c346e553e8
commit 09ebfa260f
8 changed files with 656 additions and 0 deletions

View File

@@ -0,0 +1,40 @@
[Code]
{
Helper functions
}
{
Checks to see if the installer is an 'upgrade'
}
function IsUpgrade: Boolean;
var
Value: string;
UninstallKey: string;
begin
UninstallKey := 'Software\Microsoft\Windows\CurrentVersion\Uninstall\' +
ExpandConstant('{#SetupSetting("AppId")}') + '_is1';
Result := (RegQueryStringValue(HKLM, UninstallKey, 'UninstallString', Value) or
RegQueryStringValue(HKCU, UninstallKey, 'UninstallString', Value)) and (Value <> '');
end;
{
Kills a running program by its filename
}
procedure TaskKill(fileName: String);
var
ResultCode: Integer;
begin
Exec(ExpandConstant('taskkill.exe'), '/f /im ' + '"' + fileName + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
{
Executes the MSI Uninstall by GUID functionality
}
function MsiExecUnins(appId: String): Integer;
var
ResultCode: Integer;
begin
ShellExec('', 'msiexec.exe', '/x ' + appId + ' /norestart /qb', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Result := ResultCode;
end;