-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathInnoScript.iss
More file actions
117 lines (103 loc) · 3.84 KB
/
Copy pathInnoScript.iss
File metadata and controls
117 lines (103 loc) · 3.84 KB
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
115
116
117
#define ScriptVersion "0.4"
[Setup]
AppName=YandexMusicRPC
AppPublisher=FozerG
AppVersion={#ScriptVersion}
DefaultDirName={pf}\YandexMusicRPC
DefaultGroupName=YandexMusicRPC
OutputDir=dist
AppId=YandexMusicRPC
OutputBaseFilename=YandexMusicRPC_Installer_{#ScriptVersion}
Compression=lzma
SolidCompression=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
ShowLanguageDialog=no
SetupIconFile=assets\YMRPC_ico.ico
WizardImageFile=assets\YMRPC_large_bmp.bmp
WizardSmallImageFile=assets\YMRPC_bmp.bmp
WizardImageAlphaFormat=defined
PrivilegesRequired=admin
UninstallDisplayIcon={app}\YandexMusicRPC.exe
Uninstallable=yes
AllowRootDirectory=no
AlwaysRestart=no
MinVersion=10.0.17763
[Languages]
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
Name: "english"; MessagesFile: "compiler:Default.isl"
[CustomMessages]
english.RunDescription=Run YandexMusicRPC
english.CreateDesktop=Create a desktop icon
english.AdditionalTasks=Additional tasks
russian.RunDescription=Запустить YandexMusicRPC
russian.CreateDesktop=Создать значок на рабочем столе
russian.AdditionalTasks=Дополнительные задачи
english.InstallationTitle=Installation of YandexMusicRPC
english.UpdateTitle=Update of YandexMusicRPC
english.UpdateMSG=Please ensure that the application is closed before starting the update to avoid potential errors.
russian.InstallationTitle=Установка YandexMusicRPC
russian.UpdateTitle=Обновление YandexMusicRPC
russian.UpdateMSG=Пожалуйста, убедитесь что приложение закрыто перед началом обновления, чтобы избежать возможных ошибок.
[Files]
Source: "dist\YandexMusicRPC-cli\YandexMusicRPC.exe"; DestDir: "{pf}\YandexMusicRPC"; Flags: ignoreversion
Source: "dist\YandexMusicRPC-cli\_internal\*"; DestDir: "{pf}\YandexMusicRPC\_internal"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\YandexMusicRPC"; Filename: "{pf}\YandexMusicRPC\YandexMusicRPC.exe"
Name: "{autodesktop}\YandexMusicRPC"; Filename: "{pf}\YandexMusicRPC\YandexMusicRPC.exe"; Tasks: desktopicon
[Code]
function IsAppInstalled: Boolean;
var
InstallPath: string;
begin
Result := RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\YandexMusicRPC_is1', 'InstallLocation', InstallPath);
end;
procedure InitializeWizard;
begin
if IsAppInstalled then
begin
WizardForm.Caption := CustomMessage('UpdateTitle');
MsgBox(CustomMessage('UpdateMSG'), mbInformation, MB_OK);
end
else
begin
WizardForm.Caption := CustomMessage('InstallationTitle');
end;
end;
procedure DeleteStartupShortcut;
var
StartupShortcut: string;
begin
StartupShortcut := ExpandConstant('{userappdata}\Microsoft\Windows\Start Menu\Programs\Startup\YandexMusicRPC.lnk');
if FileExists(StartupShortcut) then
begin
DeleteFile(StartupShortcut);
end;
end;
procedure DeleteRegistryEntry;
var
RunKey: string;
begin
RunKey := 'Software\Microsoft\Windows\CurrentVersion\Run';
if RegValueExists(HKEY_CURRENT_USER, RunKey, 'YandexMusicRPC') then
begin
RegDeleteValue(HKEY_CURRENT_USER, RunKey, 'YandexMusicRPC');
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usPostUninstall then
begin
DeleteStartupShortcut;
DeleteRegistryEntry;
end;
end;
[Run]
Filename: "{pf}\YandexMusicRPC\YandexMusicRPC.exe"; Description: "{cm:RunDescription}"; Flags: nowait postinstall skipifsilent
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktop}"; GroupDescription: "{cm:AdditionalTasks}"
[UninstallDelete]
Type: files; Name: "{pf}\YandexMusicRPC\_internal\*"
Type: dirifempty; Name: "{pf}\YandexMusicRPC\_internal"
Type: files; Name: "{pf}\YandexMusicRPC\YandexMusicRPC.exe"
Type: dirifempty; Name: "{pf}\YandexMusicRPC"