1. added launch configuration for vscode

2. fixed Windows resources copy in Wix msi build
This commit is contained in:
vadym 2022-11-30 11:05:02 +02:00
parent 63bb94efe1
commit 08b92fa047
2 changed files with 29 additions and 8 deletions

23
.vscode/launch.json vendored Normal file
View file

@ -0,0 +1,23 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Launch file",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "cmd/mesh/main.go",
"args": [
"-autoconf"
],
"console": "integratedTerminal",
"asRoot": true,
"env": {
"PATH": "${env:PATH}"
}
}
]
}

View file

@ -51,7 +51,7 @@ fi
PKGNAME=$(sh contrib/semver/name.sh) PKGNAME=$(sh contrib/semver/name.sh)
PKGVERSION=$(sh contrib/msi/msversion.sh --bare) PKGVERSION=$(sh contrib/msi/msversion.sh --bare)
PKGVERSIONMS=$(echo $PKGVERSION | tr - .) PKGVERSIONMS=$(echo $PKGVERSION | tr - .)
PKGINDEXFILE=contrib/ui/mesh-ui/index.html PKGUIFOLDER=contrib/ui/mesh-ui/ui
PKGLICENSEFILE=LICENSE.rtf PKGLICENSEFILE=LICENSE.rtf
#Build winres #Build winres
@ -156,6 +156,7 @@ cat > wix.xml << EOF
<Directory Id="TARGETDIR" Name="SourceDir"> <Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="DesktopFolder" SourceName="Desktop"/> <Directory Id="DesktopFolder" SourceName="Desktop"/>
<Directory Id="CopyWebViewUIFolder" SourceName="ui">
<Directory Id="${PKGINSTFOLDER}" Name="PFiles"> <Directory Id="${PKGINSTFOLDER}" Name="PFiles">
<Directory Id="MeshInstallFolder" Name="RiV-mesh"> <Directory Id="MeshInstallFolder" Name="RiV-mesh">
<Component Id="MainExecutable" Guid="c2119231-2aa3-4962-867a-9759c87beb24"> <Component Id="MainExecutable" Guid="c2119231-2aa3-4962-867a-9759c87beb24">
@ -211,11 +212,8 @@ cat > wix.xml << EOF
Source="mesh-ui.exe" Source="mesh-ui.exe"
KeyPath="yes" /> KeyPath="yes" />
<File <CopyFile Id="CopyWebViewUIFolder" SourceProperty="${PKGUIFOLDER}"
Id="WebViewHtmlFile" DestinationDirectory="ui" SourceName="*" />
Name="index.html"
DiskId="1"
Source="${PKGINDEXFILE}" />
<File <File
Id="WebViewDllFile" Id="WebViewDllFile"
@ -291,13 +289,13 @@ cat > wix.xml << EOF
Name="RiV-mesh" Name="RiV-mesh"
Description="RiV-mesh is IoT E2E encrypted network" Description="RiV-mesh is IoT E2E encrypted network"
Directory="DesktopFolder" Directory="DesktopFolder"
Target="[MeshInstallFolder]mesh-ui.exe" Target="[MeshInstallFolder]mesh-ui.exe ui\index.html"
WorkingDirectory="MeshInstallFolder"/> WorkingDirectory="MeshInstallFolder"/>
<RegistryValue Root="HKCU" Key="Software\RiV-chain\RiV-mesh" Name="installed" Type="integer" Value="1" KeyPath="yes" /> <RegistryValue Root="HKCU" Key="Software\RiV-chain\RiV-mesh" Name="installed" Type="integer" Value="1" KeyPath="yes" />
<RegistryValue Id="MerAs.rst" Root="HKMU" Action="write" <RegistryValue Id="MerAs.rst" Root="HKMU" Action="write"
Key="Software\Microsoft\Windows\CurrentVersion\Run" Key="Software\Microsoft\Windows\CurrentVersion\Run"
Name="RiV-mesh client" Name="RiV-mesh client"
Value="[MeshInstallFolder]mesh-ui.exe" Value="[MeshInstallFolder]mesh-ui.exe ui\index.html"
Type="string" /> Type="string" />
<Condition>ASSISTANCE_START_VIA_REGISTRY</Condition> <Condition>ASSISTANCE_START_VIA_REGISTRY</Condition>
</Component> </Component>