welsonjs/setup.iss

68 lines
2.2 KiB
Plaintext
Raw Normal View History

2020-07-21 09:14:46 +00:00
; @created_on 2020-06-26
2020-08-09 10:05:27 +00:00
; @updated_on 2020-08-09
2020-07-21 09:14:46 +00:00
[Setup]
2020-08-09 10:05:27 +00:00
AppName=NextVPN
AppVersion=0.1.3
2020-07-21 09:14:46 +00:00
WizardStyle=modern
2020-08-09 10:05:27 +00:00
DefaultDirName={pf}\NextVPN
DefaultGroupName=NextVPN
2020-07-21 09:14:46 +00:00
UninstallDisplayIcon={app}\UnInst.exe
Compression=lzma2
SolidCompression=yes
2020-08-09 10:05:27 +00:00
OutputDir=packages\installer
2020-07-21 09:14:46 +00:00
PrivilegesRequired=admin
ArchitecturesInstallIn64BitMode=x64
; [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}";
2020-08-09 10:05:27 +00:00
Source: "start.bat"; DestDir: "{app}";
Source: "config.js"; 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}";
2020-08-09 10:05:27 +00:00
Source: "ssloader.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;
; Source: "node_modules\*"; DestDir: "{app}/node_modules"; Flags: ignoreversion recursesubdirs;
2020-07-21 09:14:46 +00:00
[Icons]
2020-08-09 10:05:27 +00:00
Name: "{group}\Start {cm:AppName}"; Filename: "{app}\start.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]
Filename: {app}\start.bat;
2020-07-21 09:14:46 +00:00
[CustomMessages]
2020-08-09 10:05:27 +00:00
AppName=NextVPN
2020-07-21 09:14:46 +00:00
[Code]
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;