-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInstaller.iss
More file actions
157 lines (135 loc) · 5.41 KB
/
Installer.iss
File metadata and controls
157 lines (135 loc) · 5.41 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
; =====================================================
; StreamTweak v5.3.1 - GitHub Release Installer
; =====================================================
#define MyAppName "StreamTweak"
#define MyAppVersion "5.3.1"
#define MyAppPublisher "FoggyBytes"
#define MyAppExeName "StreamTweak.exe"
#define MyAppURL "https://github.com/FoggyBytes/StreamTweak"
#define ServiceName "StreamTweakService"
#define ServiceExe "StreamTweakService.exe"
#include "CodeDependencies.iss"
[Setup]
AppId={{D37D0ED6-5E8D-4131-B2C1-30A5840AC97B}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppPublisher={#MyAppPublisher}
DefaultDirName={autopf}\{#MyAppName}
DefaultGroupName={#MyAppName}
InfoBeforeFile=changelog.txt
SetupIconFile=StreamTweak\Resources\streamtweak.ico
WizardSmallImageFile=StreamTweak\Resources\streamtweak.bmp
WizardImageFile=StreamTweak\Resources\streamtweakinstaller.bmp
UninstallDisplayIcon={app}\Resources\streamtweak.ico
AllowNoIcons=yes
DirExistsWarning=no
CloseApplications=yes
Compression=lzma2
SolidCompression=yes
OutputDir=Output
OutputBaseFilename=StreamTweak_{#MyAppVersion}_Installer
PrivilegesRequired=admin
WizardStyle=modern
DisableWelcomePage=no
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Messages]
WelcomeLabel1=Welcome to the StreamTweak Setup Wizard
WelcomeLabel2=
[Tasks]
Name: "autostart"; Description: "Start {#MyAppName} automatically when Windows starts"; GroupDescription: "Auto-start Options:"; Flags: checkedonce
[Files]
; Main application
Source: "StreamTweak\bin\Release\net8.0-windows10.0.19041.0\win-x64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "StreamTweak\Resources\*"; DestDir: "{app}\Resources"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "StreamTweak\Resources\streamtweak.bmp"; Flags: dontcopy
Source: "changelog.txt"; DestDir: "{app}"; Flags: ignoreversion
; Background service (separate project build output)
Source: "StreamTweakService\bin\Release\net8.0-windows\win-x64\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commonstartup}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: autostart
[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: postinstall skipifsilent nowait
[Code]
var
LogoImage: TBitmapImage;
DevelopedByLabel: TNewStaticText;
GitHubLinkLabel: TNewStaticText;
procedure GitHubLinkClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', '{#MyAppURL}', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
procedure InitializeWizard;
var
TmpFileName: String;
begin
ExtractTemporaryFile('streamtweak.bmp');
TmpFileName := ExpandConstant('{tmp}\streamtweak.bmp');
LogoImage := TBitmapImage.Create(WizardForm);
LogoImage.Parent := WizardForm.WelcomePage;
LogoImage.Bitmap.LoadFromFile(TmpFileName);
LogoImage.Left := WizardForm.WelcomeLabel1.Left;
LogoImage.Top := WizardForm.WelcomeLabel1.Top + WizardForm.WelcomeLabel1.Height + ScaleY(25);
LogoImage.AutoSize := True;
DevelopedByLabel := TNewStaticText.Create(WizardForm);
DevelopedByLabel.Parent := WizardForm.WelcomePage;
DevelopedByLabel.Left := LogoImage.Left;
DevelopedByLabel.Top := LogoImage.Top + LogoImage.Height + ScaleY(30);
DevelopedByLabel.Caption := 'Developed by FoggyBytes © 2026';
DevelopedByLabel.Font.Size := 10;
DevelopedByLabel.AutoSize := True;
GitHubLinkLabel := TNewStaticText.Create(WizardForm);
GitHubLinkLabel.Parent := WizardForm.WelcomePage;
GitHubLinkLabel.Left := DevelopedByLabel.Left;
GitHubLinkLabel.Top := DevelopedByLabel.Top + DevelopedByLabel.Height + ScaleY(15);
GitHubLinkLabel.Caption := '{#MyAppURL}';
GitHubLinkLabel.Cursor := crHand;
GitHubLinkLabel.Font.Color := clHighlight;
GitHubLinkLabel.Font.Style := [fsUnderline];
GitHubLinkLabel.OnClick := @GitHubLinkClick;
end;
procedure CurStepChanged(CurStep: TSetupStep);
var
ResultCode: Integer;
AppDir: String;
begin
if CurStep = ssPostInstall then
begin
AppDir := ExpandConstant('{app}');
// Stop and remove any existing instance before (re)creating
Exec('sc.exe', 'stop ' + '{#ServiceName}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Exec('sc.exe', 'delete ' + '{#ServiceName}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
// Create service with automatic start, running as LocalSystem
Exec('sc.exe',
'create ' + '{#ServiceName}' +
' binPath= "' + AppDir + '\{#ServiceExe}"' +
' DisplayName= "StreamTweak Speed Service"' +
' start= auto',
'', SW_HIDE, ewWaitUntilTerminated, ResultCode);
// Set description
Exec('sc.exe',
'description ' + '{#ServiceName}' +
' "Applies network adapter speed changes for StreamTweak without UAC prompts."',
'', SW_HIDE, ewWaitUntilTerminated, ResultCode);
// Start the service immediately
Exec('sc.exe', 'start ' + '{#ServiceName}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
ResultCode: Integer;
begin
if CurUninstallStep = usUninstall then
begin
Exec('sc.exe', 'stop ' + '{#ServiceName}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Exec('sc.exe', 'delete ' + '{#ServiceName}', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
end;
function InitializeSetup: Boolean;
begin
Dependency_AddDotNet80Desktop;
Result := True;
end;