From 0dec23bc659057d46393534184ee5ab1b04c6586 Mon Sep 17 00:00:00 2001 From: "Namhyeon, Go" Date: Mon, 24 Nov 2025 00:34:10 +0900 Subject: [PATCH] Refactor installer components and registry handling Renamed 'downloadtools' and 'winservice' components to 'addtools' in setup.iss and updated related registry and icon entries to use the new component. Registry entries for script execution are now conditional on the 'addtools' component. Removed unnecessary 'pause' from uninstallService.bat for streamlined service removal. --- setup.iss | 23 +++++++++-------------- uninstallService.bat | 1 - 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/setup.iss b/setup.iss index 0cb9687..1556471 100644 --- a/setup.iss +++ b/setup.iss @@ -30,19 +30,14 @@ ChangesAssociations=yes [Components] ; Add an optional component for the user to select during installation Name: "fileassoc"; Description: "Associate .js files to run with WelsonJS"; Types: full compact custom; -Name: "winservice"; Description: "Install the Windows Service module for WelsonJS"; Types: full; -Name: "downloadtools"; Description: "Download additional tools for WelsonJS"; Types: full; +Name: "addtools"; Description: "Download additional tools for WelsonJS"; Types: full; [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""" Root: HKCR; Subkey: "{cm:AppName}.Script"; ValueType: string; ValueData: "{cm:AppName} Script"; Flags: uninsdeletekey Root: HKCR; Subkey: "{cm:AppName}.Script\DefaultIcon"; ValueType: string; ValueData: "{app}\app\favicon.ico,0"; Flags: uninsdeletekey -Root: HKCR; Subkey: "{cm:AppName}.Script\shell"; ValueType: string; ValueData: "open"; Flags: uninsdeletevalue -Root: HKCR; Subkey: "{cm:AppName}.Script\shell\open"; ValueType: string; ValueData: "Run with {cm:AppName}"; Flags: uninsdeletevalue -Root: HKCR; Subkey: "{cm:AppName}.Script\shell\open\command"; ValueType: string; ValueData: """{userappdata}\{cm:AppName}\bin\WelsonJS.Launcher.exe"" --file ""%1"""; Flags: uninsdeletevalue +Root: HKCR; Subkey: "{cm:AppName}.Script\shell"; ValueType: string; ValueData: "open"; Components: addtools; Flags: uninsdeletevalue +Root: HKCR; Subkey: "{cm:AppName}.Script\shell\open"; ValueType: string; ValueData: "Run with {cm:AppName}"; Components: addtools; Flags: uninsdeletevalue +Root: HKCR; Subkey: "{cm:AppName}.Script\shell\open\command"; ValueType: string; ValueData: """{userappdata}\{cm:AppName}\bin\WelsonJS.Launcher.exe"" --file ""%1"""; Components: addtools; Flags: uninsdeletevalue Root: HKCR; Subkey: "{cm:AppName}.Script\ScriptEngine"; ValueType: string; ValueData: "JScript"; Flags: uninsdeletevalue Root: HKCR; Subkey: "{cm:AppName}.Script\ScriptHostEncode"; ValueType: string; ValueData: "{{85131630-480C-11D2-B1F9-00C04F86C324}}"; Flags: uninsdeletevalue Root: HKCR; Subkey: ".js"; ValueType: string; ValueData: "{cm:AppName}.Script"; Components: fileassoc; Flags: uninsdeletevalue; @@ -80,7 +75,7 @@ Name: "{app}\tmp"; ; Type: files; Name: "{app}\defaultService.js" [Icons] -Name: "{group}\Start {cm:AppName} Launcher"; Filename: "{userappdata}\{cm:AppName}\bin\WelsonJS.Launcher.exe"; AfterInstall: SetElevationBit('{group}\Start {cm:AppName} Launcher.lnk'); +Name: "{group}\Start {cm:AppName} Launcher"; Filename: "{userappdata}\{cm:AppName}\bin\WelsonJS.Launcher.exe"; Components: addtools; AfterInstall: SetElevationBit('{group}\Start {cm:AppName} Launcher.lnk'); Name: "{group}\Test {cm:AppName}"; Filename: "{app}\bootstrap.bat"; AfterInstall: SetElevationBit('{group}\Test {cm:AppName}.lnk'); Name: "{group}\Uninstall {cm:AppName}"; Filename: "{uninstallexe}"; AfterInstall: SetElevationBit('{group}\Uninstall {cm:AppName}.lnk'); @@ -88,12 +83,12 @@ Name: "{group}\Uninstall {cm:AppName}"; Filename: "{uninstallexe}"; AfterInstall ; Filename: {app}\bin\gtk2-runtime-2.24.33-2021-01-30-ts-win64.exe; ; Filename: {app}\bin\nmap-7.92\VC_redist.x86.exe; ; Filename: {app}\bin\nmap-7.92\npcap-1.50.exe; -Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -NoProfile -File ""{app}\afterInstall.ps1"""; WorkingDir: "{app}"; Components: downloadtools; Flags: waituntilterminated -Filename: {app}\installService.bat; Components: winservice; Flags: nowait -Filename: "{userappdata}\{cm:AppName}\bin\WelsonJS.Launcher.exe"; Flags: nowait +Filename: "powershell.exe"; Parameters: "-ExecutionPolicy Bypass -NoProfile -File ""{app}\afterInstall.ps1"""; WorkingDir: "{app}"; Components: addtools; Flags: waituntilterminated +Filename: {app}\installService.bat; Components: addtools; Flags: nowait +Filename: "{userappdata}\{cm:AppName}\bin\WelsonJS.Launcher.exe"; Components: addtools; Flags: nowait [UninstallRun] -Filename: {app}\uninstallService.bat; Components: winservice; +Filename: {app}\uninstallService.bat; Components: addtools; Flags: waituntilterminated ; Filename: {code:GetProgramFiles}\GTK2-Runtime Win64\gtk2_runtime_uninst.exe; ; Filename: {code:GetProgramFiles}\Npcap\Uninstall.exe; ; Filename: {app}\bin\nmap-7.92\VC_redist.x86.exe; diff --git a/uninstallService.bat b/uninstallService.bat index bb35442..f860323 100644 --- a/uninstallService.bat +++ b/uninstallService.bat @@ -15,4 +15,3 @@ sc stop "%SERVICE_NAME%" "%INSTALL_UTIL_PATH%" /u "%EXE_PATH%" echo Service "%SERVICE_NAME%" removed. -pause \ No newline at end of file