-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpassy.iss
125 lines (108 loc) · 4.04 KB
/
passy.iss
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
124
125
; Inno Setup 6 script
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Passy"
#define MyAppVersion "1.8.0"
#define MyAppPublisher "GlitterWare"
#define MyAppURL "https://glitterware.github.io/Passy"
#define MyAppExeName "passy.exe"
#define CStartYear "2022"
#define CurrentYear GetDateTimeString('yyyy','','')
[Setup]
; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{AE2D44A7-B09E-4C99-8F39-3F4DFA3F15DB}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppVerName={#MyAppName} {#MyAppVersion}
VersionInfoDescription={#MyAppName} installer
VersionInfoVersion={#MyAppVersion}
VersionInfoProductName={#MyAppName}
VersionInfoProductVersion={#MyAppVersion}
AppCopyright={#MyAppPublisher} {#CStartYear}-{#CurrentYear}
UninstallDisplayIcon={app}\{#MyAppExeName}
UninstallDisplayName={#MyAppname}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
WizardStyle=modern
UsePreviousLanguage=no
ShowLanguageDialog=yes
DefaultDirName={autopf}\{#MyAppName}
DisableProgramGroupPage=yes
; Uncomment the following line to run in non administrative install mode (install for current user only.)
;PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=commandline
OutputBaseFilename=passy
Compression=lzma
SolidCompression=yes
SetupIconFile="icon48.ico"
[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"
Name: "it"; MessagesFile: "compiler:Languages\Italian.isl"
Name: "ru"; MessagesFile: "compiler:Languages\Russian.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "Release\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[UninstallDelete]
Type: files; Name: "{app}\innosetup.ini"
[Icons]
Name: "{autoprograms}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
[INI]
Filename: "{app}\innosetup.ini"; Section: "Info"; Key: "setupVersion"; String: "1.0.0"
[Code]
procedure ListFolders(const Directory: string; Folders: TStrings);
var
FindRec: TFindRec;
begin
Folders.Clear;
if FindFirst(ExpandConstant(Directory + '\*'), FindRec) then
try
repeat
if FILE_ATTRIBUTE_DIRECTORY <> 0 then
Folders.Add(FindRec.Name);
until
not FindNext(FindRec);
finally
FindClose(FindRec);
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
_valStr : string;
begin
if CurStep = ssPostInstall then begin
_valStr := ExpandConstant('{param:UninstallerUserDataRemove|false}');
if _valStr = 'true' then
SetIniBool('Uninstaller', 'userDataRemove', True, ExpandConstant('{app}\innosetup.ini'))
else
SetIniBool('Uninstaller', 'userDataRemove', False, ExpandConstant('{app}\innosetup.ini'));
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
_userFolders : TStrings;
var
_curUser : Integer;
begin
if CurUninstallStep = usUninstall then begin
_userFolders := TStringList.Create;
if FileExists(ExpandConstant('{app}\innosetup.ini')) then begin
if GetIniBool('Uninstaller', 'userDataRemove', False, ExpandConstant('{app}\innosetup.ini')) then begin
ListFolders('C:\Users', _userFolders);
repeat begin
DelTree(ExpandConstant('C:\Users\' + _userFolders[_curUser] + '\Documents\Passy'), True, True, True);
_curUser := _curUser + 1;
end;
until _curUser = _userFolders.Count;
DelTree(ExpandConstant('{userdocs}\Passy'), True, True, True);
end;
end;
end;
end;