-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathRyzenCtrl.iss.in
114 lines (101 loc) · 4.27 KB
/
RyzenCtrl.iss.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
[Setup]
AppId={{D1E0507C-61B0-4BC3-9FE4-23088D68151F}
AppName=RyzenCtrl
AppVersion=${STR_CTRL_VERSION}
WizardStyle=modern
DefaultDirName={userappdata}\RyzenCtrl
DefaultGroupName=RyzenCtrl
UninstallDisplayIcon={app}\RyzenCtrl.exe
Compression=lzma2
SolidCompression=yes
ArchitecturesInstallIn64BitMode=x64
DisableWelcomePage=no
LicenseFile=LICENSE
PrivilegesRequired=admin
DisableDirPage=no
DisableProgramGroupPage=no
OutputBaseFilename=RyzenCtrl-v.${STR_CTRL_VERSION}-Setup
VersionInfoVersion=${STR_CTRL_VERSION}
CloseApplications=force
[Files]
Source: "Appfolder\ImageFormats\qico.dll"; DestDir: "{app}\ImageFormats\"; Flags: ignoreversion
Source: "Appfolder\ImageFormats\qsvg.dll"; DestDir: "{app}\ImageFormats\"; Flags: ignoreversion
Source: "Appfolder\Platforms\qwindows.dll"; DestDir: "{app}\Platforms\"; Flags: ignoreversion
Source: "Appfolder\Styles\qwindowsvistastyle.dll"; DestDir: "{app}\Styles\"; Flags: ignoreversion
Source: "Appfolder\inpoutx64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Appfolder\libryzenadj.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Appfolder\Qt6Core.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Appfolder\Qt6Gui.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Appfolder\Qt6Svg.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Appfolder\Qt6Widgets.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Appfolder\RyzenCtrl.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "Appfolder\WinRing0x64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "Appfolder\WinRing0x64.sys"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\RyzenCtrl"; Filename: "{app}\RyzenCtrl.exe"
Name: "{group}\Uninstall"; Filename: "{uninstallexe}"
Name: "{userdesktop}\RyzenCtrl"; Filename: "{app}\RyzenCtrl.exe"; Tasks: desktopicon
Name: "{userstartup}\RyzenCtrl"; Filename: "{app}\RyzenCtrl.exe"; Tasks: addAutoStart
[Tasks]
Name: "addWindowsTask"; Description: "Autorun RyzenCtrl Service at start"; GroupDescription: "Autorun:"
Name: "addAutoStart"; Description: "Autorun RyzenCtrl GUI at start"; GroupDescription: "Autorun:"
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Run]
Filename: "{app}\RyzenCtrl.exe"; Parameters: "install"; StatusMsg: "RyzenCtrl Service windows tasks is installing. Please wait..."; Tasks: addWindowsTask
Filename: "{app}\RyzenCtrl.exe"; Description: "Launch RyzenCtrl"; Flags: postinstall nowait skipifsilent
[UninstallRun]
Filename: "{app}\RyzenCtrl.exe"; Parameters: "uninstall"
Filename: "{cmd}"; Parameters: "/C ""taskkill /im RyzenCtrl.exe /f /t"
[Code]
{ ///////////////////////////////////////////////////////////////////// }
function GetUninstallString(): String;
var
sUnInstPath: String;
sUnInstallString: String;
begin
sUnInstPath := ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{{D1E0507C-61B0-4BC3-9FE4-23088D68151F}_is1');
sUnInstallString := '';
if not RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString);
Result := sUnInstallString;
end;
{ ///////////////////////////////////////////////////////////////////// }
function IsUpgrade(): Boolean;
begin
Result := (GetUninstallString() <> '');
end;
{ ///////////////////////////////////////////////////////////////////// }
function UnInstallOldVersion(): Integer;
var
sUnInstallString: String;
iResultCode: Integer;
begin
{ Return Values: }
{ 1 - uninstall string is empty }
{ 2 - error executing the UnInstallString }
{ 3 - successfully executed the UnInstallString }
{ default return value }
Result := 0;
{ get the uninstall string of the old app }
sUnInstallString := GetUninstallString();
if sUnInstallString <> '' then begin
sUnInstallString := RemoveQuotes(sUnInstallString);
if Exec(sUnInstallString, '/SILENT /NORESTART /SUPPRESSMSGBOXES','', SW_HIDE, ewWaitUntilTerminated, iResultCode) then
Result := 3
else
Result := 2;
end else
Result := 1;
end;
{ ///////////////////////////////////////////////////////////////////// }
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep=ssInstall) then
begin
if (IsUpgrade()) then
begin
UnInstallOldVersion();
end;
end;
end;