-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetupGenerateScript.iss
More file actions
123 lines (100 loc) · 4.13 KB
/
setupGenerateScript.iss
File metadata and controls
123 lines (100 loc) · 4.13 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
118
119
120
121
122
123
#define MyAppName "CryptoJournal"
#define MyAppVersion "1.0.1"
#define MyAppPublisher "ButterDevelop"
#define MyAppURL "https://github.com/ButterDevelop/CryptoJournal.Wpf"
#define MyAppExeName "CryptoJournal.Wpf.exe"
#define MyAppDataFolderName "CryptoJournal_data"
[Setup]
AppId={{5E7D3D4C-6E22-4F54-8C9D-1E3BFEA8A8D1}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
; По умолчанию - Program Files, но пользователь сможет выбрать сам.
; В current-user режиме {autopf} автоматически станет userpf.
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=.\Output
OutputBaseFilename=Setup_CryptoJournal_{#MyAppVersion}
Compression=lzma
SolidCompression=yes
WizardStyle=modern
ArchitecturesAllowed=x64
ArchitecturesInstallIn64BitMode=x64
; По умолчанию - admin install, но пользователь сможет выбрать
; "только для меня" через встроенный диалог.
PrivilegesRequired=admin
PrivilegesRequiredOverridesAllowed=dialog
UninstallDisplayIcon={app}\{#MyAppExeName}
DisableProgramGroupPage=yes
VersionInfoVersion={#MyAppVersion}
VersionInfoCompany={#MyAppPublisher}
VersionInfoDescription=CryptoJournal installer
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion={#MyAppVersion}
; Когда настроишь подпись:
; SignTool=mycustom
; SignedUninstaller=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl"
[CustomMessages]
; ----- English -----
english.AppMutexName=CryptoJournal
english.DataFolderDeletePrompt=Also delete the "{#MyAppDataFolderName}" folder?%n%nYes - remove the program and its data.%nNo - remove only the program and keep the data.%nCancel - abort uninstall.
english.DataFolderDeleteTitle=Remove application data
english.DataFolderCreateInfo=The application data folder will be stored inside the selected installation folder.
english.DesktopIconTask=Create a desktop shortcut
; ----- Russian -----
russian.AppMutexName=CryptoJournal
russian.DataFolderDeletePrompt=Также удалить папку "{#MyAppDataFolderName}"?%n%nДа - удалить программу и данные.%nНет - удалить только программу, данные оставить.%nОтмена - прервать удаление.
russian.DataFolderDeleteTitle=Удаление данных приложения
russian.DataFolderCreateInfo=Папка данных приложения будет храниться внутри выбранной папки установки.
russian.DesktopIconTask=Создать ярлык на рабочем столе
[Tasks]
Name: "desktopicon"; Description: "{cm:DesktopIconTask}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: ".\bin\publish\win-x64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Dirs]
Name: "{app}\{#MyAppDataFolderName}"
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; WorkingDir: "{app}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon; WorkingDir: "{app}"
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent
[Code]
var
RemoveUserData: Boolean;
function GetUserDataDir: string;
begin
Result := ExpandConstant('{app}\{#MyAppDataFolderName}');
end;
function InitializeUninstall: Boolean;
var
Answer: Integer;
begin
Answer :=
MsgBox(
CustomMessage('DataFolderDeletePrompt'),
mbConfirmation,
MB_YESNOCANCEL
);
if Answer = IDCANCEL then
begin
Result := False;
Exit;
end;
RemoveUserData := (Answer = IDYES);
Result := True;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if (CurUninstallStep = usPostUninstall) and RemoveUserData then
begin
if DirExists(GetUserDataDir) then
DelTree(GetUserDataDir, True, True, True);
end;
end;