welsonjs/setup.iss

113 lines
3.7 KiB
Plaintext
Raw Normal View History

2020-07-21 09:14:46 +00:00
; @created_on 2020-06-26
2024-07-30 06:46:11 +00:00
; @updated_on 2024-07-30
2024-07-10 11:47:08 +00:00
; @author Namhyeon Go (Catswords Research) <abuse@catswords.net>
2020-07-21 09:14:46 +00:00
[Setup]
2020-11-04 08:40:21 +00:00
AppName=WelsonJS
2023-09-26 02:57:13 +00:00
AppVersion=0.2.7
2020-07-21 09:14:46 +00:00
WizardStyle=modern
2022-02-28 09:13:02 +00:00
; DefaultDirName={pf}\{cm:AppName}
DefaultDirName={commonpf}\{cm:AppName}
2022-02-28 09:02:28 +00:00
DefaultGroupName={cm:AppName}
2022-02-28 09:13:02 +00:00
; UninstallDisplayIcon={app}\UnInst.exe
UninstallDisplayIcon={app}\unins000.exe
2020-07-21 09:14:46 +00:00
Compression=lzma2
SolidCompression=yes
2020-11-04 08:40:21 +00:00
OutputDir=bin\installer
2020-07-21 09:14:46 +00:00
PrivilegesRequired=admin
ArchitecturesInstallIn64BitMode=x64
2022-02-28 08:34:33 +00:00
RestartIfNeededByRun=no
2022-02-28 09:24:34 +00:00
DisableStartupPrompt=true
DisableFinishedPage=true
DisableReadyMemo=true
DisableReadyPage=true
DisableWelcomePage=yes
DisableDirPage=yes
DisableProgramGroupPage=yes
2024-05-13 08:52:15 +00:00
LicenseFile=SECURITY.MD
2020-07-21 09:14:46 +00:00
; [Registry]
; Root: HKCR; Subkey: "welsonjs"; ValueType: "string"; ValueData: "URL:{cm:AppName}"; Flags: uninsdeletekey
; Root: HKCR; Subkey: "welsonjs"; ValueType: "string"; ValueName: "URL Protocol"; ValueData: ""
; Root: HKCR; Subkey: "welsonjs\DefaultIcon"; ValueType: "string"; ValueData: "{app}\app\favicon.ico,0"
; Root: HKCR; Subkey: "welsonjs\shell\open\command"; ValueType: "string"; ValueData: "cscript ""{app}\app.js"" uriloader ""%1"""
[Files]
Source: "app.js"; DestDir: "{app}";
Source: "app.hta"; DestDir: "{app}";
2022-02-28 09:02:28 +00:00
Source: "LICENSE"; DestDir: "{app}";
2024-05-13 08:37:54 +00:00
Source: "LICENSE_MSRL"; DestDir: "{app}";
2022-02-28 09:02:28 +00:00
Source: "*.md"; DestDir: "{app}";
2024-07-10 11:47:08 +00:00
Source: "bootstrap.bat"; DestDir: "{app}";
2020-07-21 09:14:46 +00:00
Source: "uriloader.js"; DestDir: "{app}";
Source: "webloader.js"; DestDir: "{app}";
Source: "bootstrap.js"; DestDir: "{app}";
2023-09-11 06:49:48 +00:00
Source: "scriptcontrol.js"; DestDir: "{app}";
2020-07-21 09:14:46 +00:00
Source: "app\*"; DestDir: "{app}/app"; Flags: ignoreversion recursesubdirs;
2020-08-09 10:05:27 +00:00
Source: "lib\*"; DestDir: "{app}/lib"; Flags: ignoreversion recursesubdirs;
Source: "bin\*"; DestDir: "{app}/bin"; Flags: ignoreversion recursesubdirs;
2022-02-28 09:02:28 +00:00
Source: "data\*"; DestDir: "{app}/data"; Flags: ignoreversion recursesubdirs;
2020-08-09 10:05:27 +00:00
; Source: "node_modules\*"; DestDir: "{app}/node_modules"; Flags: ignoreversion recursesubdirs;
2022-03-04 02:56:37 +00:00
; Source: "bower_components\*"; DestDir: "{app}/node_modules"; Flags: ignoreversion recursesubdirs;
2020-07-21 09:14:46 +00:00
2022-02-28 11:33:13 +00:00
[Dirs]
Name: "{app}\tmp";
2020-07-21 09:14:46 +00:00
[Icons]
2024-07-10 11:47:08 +00:00
Name: "{group}\Start {cm:AppName}"; Filename: "{app}\bootstrap.bat"; AfterInstall: SetElevationBit('{group}\Start {cm:AppName}.lnk');
2020-07-21 09:14:46 +00:00
Name: "{group}\Uninstall {cm:AppName}"; Filename: "{uninstallexe}"; AfterInstall: SetElevationBit('{group}\Uninstall {cm:AppName}.lnk');
2020-08-09 10:05:27 +00:00
[Run]
2022-02-28 08:34:33 +00:00
; Filename: {app}\bin\gtk2-runtime-2.24.33-2021-01-30-ts-win64.exe;
2023-09-11 06:49:48 +00:00
; Filename: {app}\bin\nmap-7.92\VC_redist.x86.exe;
; Filename: {app}\bin\nmap-7.92\npcap-1.50.exe;
2024-07-30 06:46:11 +00:00
Filename: {app}\installService.bat;
2024-07-10 11:47:08 +00:00
Filename: {app}\bootstrap.bat;
2022-02-28 08:34:33 +00:00
[UninstallRun]
; Filename: {code:GetProgramFiles}\GTK2-Runtime Win64\gtk2_runtime_uninst.exe;
2023-09-11 06:49:48 +00:00
; Filename: {code:GetProgramFiles}\Npcap\Uninstall.exe;
; Filename: {app}\bin\nmap-7.92\VC_redist.x86.exe;
2020-07-21 09:14:46 +00:00
[CustomMessages]
2022-02-28 09:02:47 +00:00
AppName=WelsonJS
2020-07-21 09:14:46 +00:00
[Code]
2024-05-13 08:37:54 +00:00
const
2024-05-13 08:44:16 +00:00
UninstSiteURL = 'https://github.com/gnh1201/welsonjs';
2024-05-13 08:37:54 +00:00
2020-07-21 09:14:46 +00:00
procedure SetElevationBit(Filename: string);
var
Buffer: string;
Stream: TStream;
begin
Filename := ExpandConstant(Filename);
Log('Setting elevation bit for ' + Filename);
Stream := TFileStream.Create(FileName, fmOpenReadWrite);
try
Stream.Seek(21, soFromBeginning);
SetLength(Buffer, 1);
Stream.ReadBuffer(Buffer, 1);
Buffer[1] := Chr(Ord(Buffer[1]) or $20);
Stream.Seek(-1, soFromCurrent);
Stream.WriteBuffer(Buffer, 1);
finally
Stream.Free;
end;
end;
2022-02-28 08:34:33 +00:00
function GetProgramFiles(Param: string): string;
begin
if IsWin64 then Result := ExpandConstant('{commonpf64}')
else Result := ExpandConstant('{commonpf32}')
2022-05-04 09:30:58 +00:00
end;
2024-05-13 08:37:54 +00:00
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var
ErrorCode: Integer;
begin
if CurUninstallStep = usDone then
2024-05-13 08:44:16 +00:00
ShellExec('open', UninstSiteURL, '', '', SW_SHOW, ewNoWait, ErrorCode);
2024-05-13 08:37:54 +00:00
end;