-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinstall.iss
More file actions
78 lines (70 loc) · 2.24 KB
/
install.iss
File metadata and controls
78 lines (70 loc) · 2.24 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
#define Date GetDateTimeString('yyyymmdd','','');
#define DateShort GetDateTimeString('yy.mm.dd','','');
[Setup]
AppId={{195D9982-0962-4B7A-B435-AE01735013B2}
AppName=InfostackerService
AppVersion=1.5
AppVerName=InfostackerService {#Date}
AppPublisher=Taskscape Ltd
CreateAppDir=yes
DisableWelcomePage=yes
DisableDirPage=no
DefaultDirName=C:\InfostackerService\
DefaultGroupName=InfostackerService
AllowNoIcons=yes
InfoBeforeFile=README.md
PrivilegesRequired=admin
OutputDir=_release
OutputBaseFilename=InfostackerService_{#Date}
Compression=lzma2
SolidCompression=yes
WizardStyle=modern
VersionInfoCompany=Taskscape Ltd
VersionInfoCopyright=Taskscape Ltd
VersionInfoDescription=InfostackerService
VersionInfoProductName=InfostackerService
VersionInfoProductVersion={#DateShort}
VersionInfoTextVersion={#Date}
VersionInfoVersion={#DateShort}
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "readme.md"; DestDir: "{app}"; Flags: ignoreversion;
Source: "publish\*"; DestDir: "{app}"; Excludes: "*.pdb, web.config, appsettings.json"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "publish\web.config"; DestDir: "{app}"; Flags: ignoreversion onlyifdoesntexist;
Source: "publish\appsettings.json"; DestDir: "{app}"; Flags: ignoreversion onlyifdoesntexist;
[Code]
procedure DeleteUnwantedFiles;
var
FindHandle: Integer;
FindData: TFindRec;
FileToDelete: String;
begin
// Start searching for files in the {app} directory
if FindFirst(ExpandConstant('{app}\*.*'), FindData) then
begin
try
repeat
FileToDelete := FindData.Name;
// Skip directories, 'web.config', and 'appsettings.json'
if (FindData.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0) and
(CompareText(FileToDelete, 'web.config') <> 0) and
(CompareText(FileToDelete, 'appsettings.json') <> 0) then
begin
// Delete the file
DeleteFile(ExpandConstant('{app}\') + FileToDelete);
end;
until not FindNext(FindData);
finally
FindClose(FindData);
end;
end;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
// Call the procedure to delete unwanted files just before installation
DeleteUnwantedFiles;
end;
end;