From eb74b6cc1dae1592ad5d99340b39000b7bf2be23 Mon Sep 17 00:00:00 2001 From: Vladimir Stoilov Date: Fri, 11 Oct 2024 19:23:06 +0300 Subject: [PATCH] [WIP] Fix path of the windows installers --- desktop/tauri/src-tauri/templates/files.wxs | 24 ++++++------- .../templates/nsis_install_hooks.nsh | 36 +++++++++---------- .../windows/generate_windows_installers.ps1 | 22 ------------ 3 files changed, 28 insertions(+), 54 deletions(-) diff --git a/desktop/tauri/src-tauri/templates/files.wxs b/desktop/tauri/src-tauri/templates/files.wxs index d69ec0f9..4828178f 100644 --- a/desktop/tauri/src-tauri/templates/files.wxs +++ b/desktop/tauri/src-tauri/templates/files.wxs @@ -12,21 +12,21 @@ - - - - - + + + + + - - - - - - - + + + + + + + diff --git a/desktop/tauri/src-tauri/templates/nsis_install_hooks.nsh b/desktop/tauri/src-tauri/templates/nsis_install_hooks.nsh index b2ddd628..6b5afb58 100644 --- a/desktop/tauri/src-tauri/templates/nsis_install_hooks.nsh +++ b/desktop/tauri/src-tauri/templates/nsis_install_hooks.nsh @@ -1,23 +1,23 @@ !macro NSIS_HOOK_PREINSTALL - ; Current working directory is \target\release\nsis\x64 + ; Current working directory is \desktop\tauri\src-tauri\target\release\nsis\x64 SetOutPath "$INSTDIR" - File "..\..\..\..\binaries\bin-index.json" - File "..\..\..\..\binaries\portmaster-core.exe" - File "..\..\..\..\binaries\portmaster-kext.sys" - File "..\..\..\..\binaries\portmaster.zip" - File "..\..\..\..\binaries\assets.zip" + File "..\..\..\..\binary\bin-index.json" + File "..\..\..\..\binary\portmaster-core.exe" + File "..\..\..\..\binary\portmaster-kext.sys" + File "..\..\..\..\binary\portmaster.zip" + File "..\..\..\..\binary\assets.zip" SetOutPath "$COMMONPROGRAMDATA\Portmaster\intel" - File "..\..\..\..\binaries\intel-index.json" - File "..\..\..\..\binaries\base.dsdl" - File "..\..\..\..\binaries\geoipv4.mmdb" - File "..\..\..\..\binaries\geoipv6.mmdb" - File "..\..\..\..\binaries\index.dsd" - File "..\..\..\..\binaries\intermediate.dsdl" - File "..\..\..\..\binaries\urgent.dsdl" + File "..\..\..\..\intel\intel-index.json" + File "..\..\..\..\intel\base.dsdl" + File "..\..\..\..\intel\geoipv4.mmdb" + File "..\..\..\..\intel\geoipv6.mmdb" + File "..\..\..\..\intel\index.dsd" + File "..\..\..\..\intel\intermediate.dsdl" + File "..\..\..\..\intel\urgent.dsdl" ; restire previous state SetOutPath "$INSTDIR" @@ -25,15 +25,11 @@ !macroend !macro NSIS_HOOK_POSTINSTALL - ExecWait 'sc.exe create PortmasterCore binPath= "$INSTDIR\portmaster-core.exe" --data="$COMMONPROGRAMDATA\Portmaster\data"' $0 - IntCmp $0 0 +2 - MessageBox MB_OK "Failed to create PortmasterCore service." + ExecWait 'sc.exe create PortmasterCore binPath= "$INSTDIR\portmaster-core.exe" --data="$COMMONPROGRAMDATA\Portmaster\data"' !macroend !macro NSIS_HOOK_PREUNINSTALL - ExecWait 'sc.exe stop PortmasterCore' $0 - ; Ignore errors if the service is not running - ExecWait 'sc.exe delete PortmasterCore' $0 - ; Ignore errors if the service does not exist + ExecWait 'sc.exe stop PortmasterCore' + ExecWait 'sc.exe delete PortmasterCore' !macroend diff --git a/packaging/windows/generate_windows_installers.ps1 b/packaging/windows/generate_windows_installers.ps1 index 85049f59..9027025c 100644 --- a/packaging/windows/generate_windows_installers.ps1 +++ b/packaging/windows/generate_windows_installers.ps1 @@ -72,25 +72,3 @@ Copy-Item -Path ".\target\release\bundle\nsis\*" -Destination $installerDist # Restore the original directory Set-Location $originalDirectory - -# FIXME: remove -function Show-Tree { - param ( - [string]$Path = ".", - [int]$Indent = 0 - ) - - $items = Get-ChildItem -Path $Path - - foreach ($item in $items) { - Write-Host (" " * $Indent) -NoNewline - Write-Host "+-- " -NoNewline - Write-Host $item.Name - - if ($item.PSIsContainer) { - Show-Tree -Path $item.FullName -Indent ($Indent + 4) - } - } -} - -Show-Tree 'C:\Program Files (x86)\Windows Kits\10\Include'