-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSetupScript.iss
More file actions
103 lines (85 loc) · 2.8 KB
/
Copy pathSetupScript.iss
File metadata and controls
103 lines (85 loc) · 2.8 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
; DHLabel – Winget-konformer Installer (ProgramData-Variante)
#define MyAppName "DHLabel"
#define MyAppVersion "1.5.7"
#define MyAppExeName MyAppName + ".exe"
#define MyAppPublisher "NASS e.K."
#define MyAppURL "https://www.nass-ek.de"
[Setup]
AppId={{66E110ED-DFB6-4A7D-891E-63652FDBD51C}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
; 🔑 WINGET-ENTSCHEIDUNGEN
PrivilegesRequired=lowest
DefaultDirName={commonappdata}\{#MyAppName}
DisableDirPage=yes
DisableProgramGroupPage=yes
DisableWelcomePage=yes
DisableFinishedPage=yes
LicenseFile=D:\Dokumente\gpl_de.txt
OutputDir=Program\bin\Release\x64
OutputBaseFilename={#MyAppName}-Setup-{#MyAppVersion}
SetupIconFile=D:\Bilder\nass-ek.ico
UninstallDisplayIcon={app}\{#MyAppExeName},0
Compression=lzma
SolidCompression=yes
WizardStyle=modern
SignTool=Certum
[Languages]
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}";
Name: "{userdesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon;
[Files]
Source: "E:\Windows\DHLabel\Program\bin\Release\x64\DHLabel.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\Windows\DHLabel\Program\bin\Release\x64\pdfium_x64.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "E:\Windows\DHLabel\Program\bin\Release\x64\de\DHLabel.resources.dll"; DestDir: "{app}\de"; Flags: ignoreversion
[Registry]
; Nur per-User-Registry – erlaubt & korrekt
Root: HKCU; Subkey: "Software\{#MyAppName}"; Flags: uninsdeletekey
[Code]
function GetUninstallString(): String;
var
sUnInstPath: String;
sUnInstallString: String;
begin
sUnInstPath :=
ExpandConstant('Software\Microsoft\Windows\CurrentVersion\Uninstall\{#emit SetupSetting("AppId")}_is1');
sUnInstallString := '';
if not RegQueryStringValue(HKCU, sUnInstPath, 'UninstallString', sUnInstallString) then
RegQueryStringValue(HKLM, sUnInstPath, 'UninstallString', sUnInstallString);
Result := sUnInstallString;
end;
function IsUpgrade(): Boolean;
begin
Result := (GetUninstallString() <> '');
end;
procedure UnInstallOldVersion();
var
sUnInstallString: String;
iResultCode: Integer;
begin
sUnInstallString := GetUninstallString();
if sUnInstallString <> '' then
begin
sUnInstallString := RemoveQuotes(sUnInstallString);
Exec(
sUnInstallString,
'/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-',
'',
SW_HIDE,
ewWaitUntilTerminated,
iResultCode
);
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if (CurStep = ssInstall) and IsUpgrade() then
UnInstallOldVersion();
end;