-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathYTDLGUISetupScript.iss
More file actions
158 lines (141 loc) · 6.97 KB
/
Copy pathYTDLGUISetupScript.iss
File metadata and controls
158 lines (141 loc) · 6.97 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
158
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define MyAppName "Youtube-dl GUI"
#define MyAppVersion "2026.04.22.f8"
#define MyNumericVersion "2026.04.22.8"
#define MyAppPublisher "TransparentBox Co."
#define MyAppExeName "DownloaderGUI.exe"
#define MyAppAssocName MyAppName + " File"
#define MyAppAssocExt ".ytdl"
#define MyAppAssocKey StringChange(MyAppAssocName, " ", "") + MyAppAssocExt
[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={{56FC58A4-4C3E-4BB6-BBDD-E631B9C892D1}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
AppComments=A GUI for Youtube-dl
AppVerName={#MyAppName} v{#MyAppVersion}
AppUpdatesURL=https://github.com/alex-ljohnson/ytdl-gui/releases/latest
AppPublisher={#MyAppPublisher}
AppPublisherURL=https://www.transparentbox.uk
AppCopyright=Copyright (C) 2021 Alexander Johnson
DefaultDirName={autopf}\{#MyAppName}
ChangesAssociations=yes
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
InfoBeforeFile=.\info\preInfo.txt
LicenseFile=.\LICENSE
; Remove the following line to run in administrative install mode (install for all users.)
;PrivilegesRequired=admin
PrivilegesRequired=lowest
PrivilegesRequiredOverridesAllowed=dialog
OutputDir=.\dist\Installer
OutputBaseFilename=Youtube-dl_GUI_Setup
SetupIconFile=.\Resources\YTDLv2_256.ico
UninstallDisplayIcon=.\Resources\YTDLv2_256.ico
Compression=lzma2/max
SolidCompression=no
WizardStyle=modern dynamic
ArchitecturesAllowed=win64
#ifndef NOSIGN
SignTool=standard
#endif
CloseApplications=yes
WizardSmallImageFile=.\Resources\YTDLv2_55.bmp,.\Resources\YTDLv2_128.bmp
WizardImageFile=.\Resources\YTDLv2_256.bmp
VersionInfoVersion={#MyNumericVersion}
VersionInfoCompany={#MyAppPublisher}
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Tasks]
; Add '; Flags: unchecked' to the below line to set it as off by default
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"
Name: "desktopicon\user"; Description: "For current user only"; GroupDescription: "{cm:AdditionalIcons}"; Flags: exclusive
Name: "desktopicon\common"; Description: "For all users"; GroupDescription: "{cm:AdditionalIcons}"; Flags: exclusive unchecked
[Components]
Name: "ffmpeg"; Description: "Install FFmpeg 7.1 (a/v processing and format conversion); Uncheck to use system version or provide your own"; ExtraDiskSpaceRequired: 48000000
Name: "quickjs"; Description: "QuickJS runtime (JavaScript engine required for YouTube; uncheck if you have Node.js, Deno, Bun, or qjs on your PATH)"; ExtraDiskSpaceRequired: 400000
[Files]
Source: ".\dist\DownloaderGUI\{#MyAppExeName}"; DestDir: "{app}"
Source: ".\dist\DownloaderGUI\_internal\README.md"; DestDir: "{app}"; Flags: isreadme
Source: ".\dist\DownloaderGUI\*"; DestDir: "{app}"; Check: FullInstall; Excludes: "{#MyAppExeName},ffmpeg-7.1-essentials_build\*,quickjs\*"
Source: ".\dist\DownloaderGUI\_internal\*"; DestDir: "{app}\_internal"; Check: FullInstall; Flags: recursesubdirs createallsubdirs; Excludes: "{#MyAppExeName},ffmpeg-7.1-essentials_build\*,quickjs\*"
Source: ".\dist\DownloaderGUI\_internal\ffmpeg-7.1-essentials_build\*"; DestDir: "{app}\_internal\ffmpeg-7.1-essentials_build"; Check: FullInstall; Components: ffmpeg; Flags: recursesubdirs createallsubdirs
Source: ".\dist\DownloaderGUI\_internal\quickjs\*"; DestDir: "{app}\_internal\quickjs"; Check: FullInstall; Components: quickjs; Flags: recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
; Full Install only used in updater func, if dependencies haven't changed, to install the exe only.
[Registry]
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocExt}\OpenWithProgids"; ValueType: string; ValueName: "{#MyAppAssocKey}"; ValueData: ""; Flags: uninsdeletevalue
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}"; ValueType: string; ValueName: ""; ValueData: "{#MyAppAssocName}"; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\DefaultIcon"; ValueType: string; ValueName: ""; ValueData: "{app}\{#MyAppExeName},0"
Root: HKA; Subkey: "Software\Classes\{#MyAppAssocKey}\shell\open\command"; ValueType: string; ValueName: ""; ValueData: """{app}\{#MyAppExeName}"" ""%1"""
Root: HKA; Subkey: "Software\Classes\Applications\{#MyAppExeName}\SupportedTypes"; ValueType: string; ValueName: "{#MyAppAssocExt}"; ValueData: ""; Flags: uninsdeletekey
Root: HKA; Subkey: "Software\{#MyAppName}\installedVersions"; ValueType: string; ValueName: "{#MyAppVersion}"; ValueData: "{#MyAppVersion}"; Flags: uninsdeletevalue
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{autodesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Run]
;Filename: "{app}\README.md"; Description: "View README File"; Flags: shellexec postinstall skipifsilent skipifdoesntexist ; Not needed automatically does this
;Below line allows 'Run <program name>;' Checkbox after install
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}"; Flags: nowait postinstall skipifsilent
Filename: "{app}\{#MyAppExeName}"; Check: ShouldLaunchAfterInstall; Flags: nowait
[Code]
function ShouldLaunchAfterInstall(): Boolean;
begin
Result := ExpandConstant('{param:launch|false}') = 'true';
end;
function FullInstall(): Boolean;
begin
Result := True
if ExpandConstant('{param:fullinstall|true}') = 'false' then
Result := False
end;
function FfmpegOnPath(): Boolean;
begin
Result := (FileSearch('ffmpeg.exe', GetEnv('PATH')) <> '') and (FileSearch('ffprobe.exe', GetEnv('PATH')) <> '');
end;
function JsRuntimeOnPath(): Boolean;
var
PathEnv: String;
begin
PathEnv := GetEnv('PATH');
Result := (FileSearch('deno.exe', PathEnv) <> '') or
(FileSearch('bun.exe', PathEnv) <> '') or
(FileSearch('node.exe', PathEnv) <> '') or
(FileSearch('qjs.exe', PathEnv) <> '');
end;
procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = wpSelectComponents then
begin
if FfmpegOnPath() then
WizardSelectComponents('!ffmpeg')
else
WizardSelectComponents('ffmpeg');
if JsRuntimeOnPath() then
WizardSelectComponents('!quickjs')
else
WizardSelectComponents('quickjs');
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
DataPath: String;
begin
if CurUninstallStep = usUninstall then
begin
DataPath := ExpandConstant('{userappdata}\Youtube-dl_GUI');
if DirExists(DataPath) then
if MsgBox(
'Do you want to remove your saved settings, download list and token cache?' + #13#10 +
'(' + DataPath + ')',
mbConfirmation, MB_YESNO) = IDYES then
DelTree(DataPath, True, True, True);
end;
end;
procedure DeinitializeSetup();
begin
if ExpandConstant('{param:deleteinstaller|false}') = 'true' then
DeleteFile(ExpandConstant('{srcexe}'));
end;