[WIP] updater rafactoring, minor improvments

This commit is contained in:
Vladimir Stoilov
2024-09-17 12:36:44 +03:00
parent 83ec18f552
commit 84a15b5fb3
18 changed files with 380 additions and 310 deletions

View File

@@ -33,7 +33,9 @@ Update WIX installer template:
2. Replace the contents of `templates/main_original.wxs` with the repository version.
3. Replace the contents of `templates/main.wsx` and add the fallowing lines at the end of the file, inside the `Product` tag.
```xml
<!-- Service fragments -->
<CustomActionRef Id='InstallPortmasterService' />
<CustomActionRef Id='StopPortmasterService' />
<CustomActionRef Id='DeletePortmasterService' />
<!-- End Service fragments -->
```

View File

@@ -109,8 +109,10 @@
},
"wix": {
"fragmentPaths": [
"templates/service.wxs"
"templates/service.wxs",
"templates/files.wxs"
],
"componentGroupRefs": ["BinaryAndIntelFiles"],
"template": "templates/main.wxs"
}
},

View File

@@ -0,0 +1,36 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="INSTALLDIR">
<Directory Id="BinaryDir" Name="binary" />
<Directory Id="IntelDir" Name="intel" />
</DirectoryRef>
</Fragment>
<Fragment>
<Component Id="BinaryFiles" Directory="BinaryDir" Guid="850cdd31-424d-45f5-b8f0-95df950ebd0d">
<File Id="BinIndexJson" Source="..\..\..\..\binaries\bin-index.json" />
<File Id="PortmasterCoreExe" Source="..\..\..\..\binaries\portmaster-core.exe" />
<File Id="PortmasterKextSys" Source="..\..\..\..\binaries\portmaster-kext.sys" />
<File Id="PortmasterZip" Source="..\..\..\..\binaries\portmaster.zip" />
<File Id="AssetsZip" Source="..\..\..\..\binaries\assets.zip" />
</Component>
<Component Id="IntelFiles" Directory="IntelDir" Guid="0bb439f1-2075-45b0-95bf-78ed3dffeb69">
<File Id="IntelIndexJson" Source="..\..\..\..\binaries\intel-index.json" />
<File Id="BaseDsdl" Source="..\..\..\..\binaries\base.dsdl" />
<File Id="Geoipv4Mmdb" Source="..\..\..\..\binaries\geoipv4.mmdb" />
<File Id="Geoipv6Mmdb" Source="..\..\..\..\binaries\geoipv6.mmdb" />
<File Id="IndexDsd" Source="..\..\..\..\binaries\index.dsd" />
<File Id="IntermediateDsdl" Source="..\..\..\..\binaries\intermediate.dsdl" />
<File Id="UrgentDsdl" Source="..\..\..\..\binaries\urgent.dsdl" />
</Component>
</Fragment>
<Fragment>
<ComponentGroup Id="BinaryAndIntelFiles">
<ComponentRef Id="BinaryFiles" />
<ComponentRef Id="IntelFiles" />
</ComponentGroup>
</Fragment>
</Wix>

View File

@@ -341,14 +341,16 @@
</InstallExecuteSequence>
{{/if}}
<CustomActionRef Id='InstallPortmasterService' />
<CustomActionRef Id='StopPortmasterService' />
<CustomActionRef Id='DeletePortmasterService' />
<InstallExecuteSequence>
<Custom Action="LaunchApplication" After="InstallFinalize">AUTOLAUNCHAPP AND NOT Installed</Custom>
</InstallExecuteSequence>
<SetProperty Id="ARPINSTALLLOCATION" Value="[INSTALLDIR]" After="CostFinalize"/>
<!-- Service fragments -->
<CustomActionRef Id='InstallPortmasterService' />
<CustomActionRef Id='StopPortmasterService' />
<CustomActionRef Id='DeletePortmasterService' />
<!-- End Service fragments -->
</Product>
</Wix>

View File

@@ -3,7 +3,7 @@
<Fragment>
<CustomAction Id="InstallPortmasterService"
Directory="INSTALLDIR"
ExeCommand="&quot;[INSTALLDIR]portmaster-start.exe&quot; install core-service --data=&quot;[INSTALLDIR]data&quot;"
ExeCommand="sc.exe create PortmasterCore binPath= &quot;[INSTALLDIR]binary\portmaster-core.exe --data [INSTALLDIR]data&quot;"
Execute="commit"
Return="check"
Impersonate="no"