[WIP] Fix path of the windows installers

This commit is contained in:
Vladimir Stoilov 2024-10-11 19:23:06 +03:00
parent 6be7330621
commit eb74b6cc1d
No known key found for this signature in database
GPG key ID: 2F190B67A43A81AF
3 changed files with 28 additions and 54 deletions

View file

@ -12,21 +12,21 @@
<Fragment> <Fragment>
<Component Id="BinaryFiles" Directory="INSTALLDIR" Guid="850cdd31-424d-45f5-b8f0-95df950ebd0d"> <Component Id="BinaryFiles" Directory="INSTALLDIR" Guid="850cdd31-424d-45f5-b8f0-95df950ebd0d">
<File Id="BinIndexJson" Source="..\..\..\..\binaries\bin-index.json" /> <File Id="BinIndexJson" Source="..\..\..\..\binary\bin-index.json" />
<File Id="PortmasterCoreExe" Source="..\..\..\..\binaries\portmaster-core.exe" /> <File Id="PortmasterCoreExe" Source="..\..\..\..\binary\portmaster-core.exe" />
<File Id="PortmasterKextSys" Source="..\..\..\..\binaries\portmaster-kext.sys" /> <File Id="PortmasterKextSys" Source="..\..\..\..\binary\portmaster-kext.sys" />
<File Id="PortmasterZip" Source="..\..\..\..\binaries\portmaster.zip" /> <File Id="PortmasterZip" Source="..\..\..\..\binary\portmaster.zip" />
<File Id="AssetsZip" Source="..\..\..\..\binaries\assets.zip" /> <File Id="AssetsZip" Source="..\..\..\..\binary\assets.zip" />
</Component> </Component>
<Component Id="IntelFiles" Directory="IntelDir" Guid="0bb439f1-2075-45b0-95bf-78ed3dffeb69"> <Component Id="IntelFiles" Directory="IntelDir" Guid="0bb439f1-2075-45b0-95bf-78ed3dffeb69">
<File Id="IntelIndexJson" Source="..\..\..\..\binaries\intel-index.json" /> <File Id="IntelIndexJson" Source="..\..\..\..\intel\intel-index.json" />
<File Id="BaseDsdl" Source="..\..\..\..\binaries\base.dsdl" /> <File Id="BaseDsdl" Source="..\..\..\..\intel\base.dsdl" />
<File Id="Geoipv4Mmdb" Source="..\..\..\..\binaries\geoipv4.mmdb" /> <File Id="Geoipv4Mmdb" Source="..\..\..\..\intel\geoipv4.mmdb" />
<File Id="Geoipv6Mmdb" Source="..\..\..\..\binaries\geoipv6.mmdb" /> <File Id="Geoipv6Mmdb" Source="..\..\..\..\intel\geoipv6.mmdb" />
<File Id="IndexDsd" Source="..\..\..\..\binaries\index.dsd" /> <File Id="IndexDsd" Source="..\..\..\..\intel\index.dsd" />
<File Id="IntermediateDsdl" Source="..\..\..\..\binaries\intermediate.dsdl" /> <File Id="IntermediateDsdl" Source="..\..\..\..\intel\intermediate.dsdl" />
<File Id="UrgentDsdl" Source="..\..\..\..\binaries\urgent.dsdl" /> <File Id="UrgentDsdl" Source="..\..\..\..\intel\urgent.dsdl" />
</Component> </Component>
</Fragment> </Fragment>

View file

@ -1,23 +1,23 @@
!macro NSIS_HOOK_PREINSTALL !macro NSIS_HOOK_PREINSTALL
; Current working directory is <project-dir>\target\release\nsis\x64 ; Current working directory is <project-dir>\desktop\tauri\src-tauri\target\release\nsis\x64
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
File "..\..\..\..\binaries\bin-index.json" File "..\..\..\..\binary\bin-index.json"
File "..\..\..\..\binaries\portmaster-core.exe" File "..\..\..\..\binary\portmaster-core.exe"
File "..\..\..\..\binaries\portmaster-kext.sys" File "..\..\..\..\binary\portmaster-kext.sys"
File "..\..\..\..\binaries\portmaster.zip" File "..\..\..\..\binary\portmaster.zip"
File "..\..\..\..\binaries\assets.zip" File "..\..\..\..\binary\assets.zip"
SetOutPath "$COMMONPROGRAMDATA\Portmaster\intel" SetOutPath "$COMMONPROGRAMDATA\Portmaster\intel"
File "..\..\..\..\binaries\intel-index.json" File "..\..\..\..\intel\intel-index.json"
File "..\..\..\..\binaries\base.dsdl" File "..\..\..\..\intel\base.dsdl"
File "..\..\..\..\binaries\geoipv4.mmdb" File "..\..\..\..\intel\geoipv4.mmdb"
File "..\..\..\..\binaries\geoipv6.mmdb" File "..\..\..\..\intel\geoipv6.mmdb"
File "..\..\..\..\binaries\index.dsd" File "..\..\..\..\intel\index.dsd"
File "..\..\..\..\binaries\intermediate.dsdl" File "..\..\..\..\intel\intermediate.dsdl"
File "..\..\..\..\binaries\urgent.dsdl" File "..\..\..\..\intel\urgent.dsdl"
; restire previous state ; restire previous state
SetOutPath "$INSTDIR" SetOutPath "$INSTDIR"
@ -25,15 +25,11 @@
!macroend !macroend
!macro NSIS_HOOK_POSTINSTALL !macro NSIS_HOOK_POSTINSTALL
ExecWait 'sc.exe create PortmasterCore binPath= "$INSTDIR\portmaster-core.exe" --data="$COMMONPROGRAMDATA\Portmaster\data"' $0 ExecWait 'sc.exe create PortmasterCore binPath= "$INSTDIR\portmaster-core.exe" --data="$COMMONPROGRAMDATA\Portmaster\data"'
IntCmp $0 0 +2
MessageBox MB_OK "Failed to create PortmasterCore service."
!macroend !macroend
!macro NSIS_HOOK_PREUNINSTALL !macro NSIS_HOOK_PREUNINSTALL
ExecWait 'sc.exe stop PortmasterCore' $0 ExecWait 'sc.exe stop PortmasterCore'
; Ignore errors if the service is not running ExecWait 'sc.exe delete PortmasterCore'
ExecWait 'sc.exe delete PortmasterCore' $0
; Ignore errors if the service does not exist
!macroend !macroend

View file

@ -72,25 +72,3 @@ Copy-Item -Path ".\target\release\bundle\nsis\*" -Destination $installerDist
# Restore the original directory # Restore the original directory
Set-Location $originalDirectory 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'