update the way the installer is generated to use /setversion to allow in-place upgrading

This commit is contained in:
ziti-ci
2020-11-01 15:39:20 -05:00
parent 7e3daa0d67
commit 306c9bdc4c
3 changed files with 23 additions and 67 deletions
+8 -8
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DOCUMENT Type="Advanced Installer" CreateVersion="17.4.1" version="17.5" Modules="professional" RootPath="." Language="en" Id="{7315FE7B-0418-4F38-8B12-6C0594276D30}">
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DOCUMENT Type="Advanced Installer" CreateVersion="17.4.1" version="17.6" Modules="professional" RootPath="." Language="en" Id="{7315FE7B-0418-4F38-8B12-6C0594276D30}">
<COMPONENT cid="caphyon.advinst.msicomp.MsiPropsComponent">
<ROW Property="AI_BITMAP_DISPLAY_MODE" Value="0"/>
<ROW Property="AI_BackgroundColor" Value="lightblue" MsiKey="AI_BackgroundColor"/>
@@ -22,10 +22,10 @@
<ROW Property="ARPURLINFOABOUT" Value="https://ziti.dev"/>
<ROW Property="CTRLS" Value="2"/>
<ROW Property="Manufacturer" Value="NetFoundry, Inc."/>
<ROW Property="ProductCode" Value="1033:{56EED0BB-F24E-45B6-BA55-F7CE249C92AB} " Type="16"/>
<ROW Property="ProductCode" Value="1033:{7FCA1F4D-8685-4B3F-A351-123E8A63FE52} " Type="16"/>
<ROW Property="ProductLanguage" Value="1033"/>
<ROW Property="ProductName" Value="Ziti Desktop Edge"/>
<ROW Property="ProductVersion" Value="1.2.13" Type="32"/>
<ROW Property="ProductVersion" Value="1.3.0" Type="32"/>
<ROW Property="SecureCustomProperties" Value="OLDPRODUCTS;AI_NEWERPRODUCTFOUND;AI_SETUPEXEPATH;SETUPEXEDIR"/>
<ROW Property="UpgradeCode" Value="{CB7E173A-663D-4A23-BB22-D1E8D885C2F3}"/>
<ROW Property="WindowsType9X" MultiBuildValue="DefaultBuild:Windows 9x/ME#AnyCPU_Release:Windows 9x/ME" ValueLocId="-"/>
@@ -265,12 +265,12 @@
<ROW Registry="Version" Root="-1" Key="Software\[Manufacturer]\[ProductName]" Name="Version" Value="[ProductVersion]" Component_="ProductInformation"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiServCtrlComponent">
<ROW ServiceControl="ZitiUpdateService.exe" Name="Ziti Desktop Monitor Service" Event="160" Wait="0" Component_="ZitiUpdateService.exe"/>
<ROW ServiceControl="zititunnel.exe" Name="ziti" Event="161" Wait="1" Component_="zititunnel.exe"/>
<ROW ServiceControl="ZitiUpdateService.exe" Name="ziti-monitor" Event="160" Wait="0" Component_="ZitiUpdateService.exe"/>
<ROW ServiceControl="zititunnel.exe" Name="ziti" Event="161" Wait="0" Component_="zititunnel.exe"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiServInstComponent">
<ROW ServiceInstall="ZitiUpdateService.exe" Name="Ziti Desktop Monitor Service" DisplayName="Ziti Desktop Monitor Service" ServiceType="16" StartType="2" ErrorControl="1" Component_="ZitiUpdateService.exe" Description="Monitor and update your Ziti Access Services"/>
<ROW ServiceInstall="zititunnel.exe" Name="ziti" DisplayName="Ziti Desktop Edge Service" ServiceType="16" StartType="2" ErrorControl="32769" Component_="zititunnel.exe" Description="Access your Ziti Secured Assets"/>
<ROW ServiceInstall="ZitiUpdateService.exe" Name="ziti-monitor" DisplayName="Ziti Desktop Monitor Service" ServiceType="16" StartType="2" ErrorControl="1" Component_="ZitiUpdateService.exe" Description="Monitors and updates the Ziti Access Service"/>
<ROW ServiceInstall="zititunnel.exe" Name="ziti" DisplayName="Ziti Desktop Edge Service" ServiceType="16" StartType="2" ErrorControl="32769" Component_="zititunnel.exe" Description="Access your Networks Secured by Ziti"/>
</COMPONENT>
<COMPONENT cid="caphyon.advinst.msicomp.MsiShortsComponent">
<ROW Shortcut="ZitiDesktopEdge.exe" Directory_="SHORTCUTDIR" Name="ZITIDE~1|Ziti Desktop Edge" Component_="ZitiDesktopEdge.exe" Target="[#ZitiDesktopEdge.exe]" Description="Ziti Desktop Edge configuration interface" Hotkey="0" Icon_="ziti.exe" IconIndex="0" ShowCmd="1" WkDir="APPDIR"/>
+2 -35
View File
@@ -4,48 +4,15 @@ rm .\build -r -fo -ErrorAction Ignore
$invocation = (Get-Variable MyInvocation).Value
$scriptPath = Split-Path $invocation.MyCommand.Path
${scriptPath}
$x=[xml] @"
$((Invoke-WebRequest https://netfoundry.jfrog.io/artifactory/ziti-maven-snapshot/ziti-tunnel-win/amd64/windows/ziti-tunnel-win/maven-metadata.xml).Content)
"@
echo "the branch is $env:GIT_BRANCH"
$branch = git rev-parse --abbrev-ref HEAD
if ("$branch" -ne 'master') {
#if the git command to get the branch fails - this is 'not master' use the 'latest' - else fetch the 'release'
$serviceVersion = $x.metadata.versioning.latest
}
else {
$serviceVersion = $x.metadata.versioning.release
}
echo "service version is: $serviceVersion"
$installerVersion=(Get-Content -Path .\version)
$zipUrl = "https://netfoundry.jfrog.io/artifactory/ziti-maven-snapshot/ziti-tunnel-win/amd64/windows/ziti-tunnel-win/${serviceVersion}/ziti-tunnel-win-${serviceVersion}.zip"
echo "Downloading zip file "
echo " from: $zipUrl"
tree ${scriptPath}..
$ProgressPreference = 'SilentlyContinue'
$timeTaken = Measure-Command -Expression {
Invoke-WebRequest $zipUrl -OutFile ziti-tunnel-service.zip
}
$zipLocal = "ziti-tunnel-service.zip"
$zipLocal = "${scriptPath}/../service/ziti-tunnel-win.zip"
$milliseconds = $timeTaken.TotalMilliseconds
echo " time to download: $milliseconds"
echo ""
echo "unzipping $zipLocal to ${scriptPath}\build\service\"
$ProgressPreference = 'Continue'
Expand-Archive -Verbose -Force -LiteralPath $zipLocal "${scriptPath}\build\service\"
Push-Location ${scriptPath}\..
@@ -53,7 +20,6 @@ echo "Updating the version for UI and Installer"
.\update-versions.ps1
echo "Building the UI"
#msbuild DesktopEdge\ZitiDesktopEdge.csproj /property:Configuration=Release
msbuild ZitiDesktopEdge.sln /property:Configuration=Release
echo "Building the Wintun installer"
@@ -63,8 +29,9 @@ Pop-Location
$ADVINST = "C:\Program Files (x86)\Caphyon\Advanced Installer 17.6\bin\x86\AdvancedInstaller.com"
$ADVPROJECT = "${scriptPath}\ZitiDesktopEdge.aip"
$installerVersion=(Get-Content -Path ${scriptPath}\..\version)
$action = '/SetVersion'
echo "issuing $ADVINST /edit $ADVPROJECT $action $installerVersion (service version: $serviceVersion) - see https://www.advancedinstaller.com/user-guide/set-version.html"
& $ADVINST /edit $ADVPROJECT $action $installerVersion
+13 -24
View File
@@ -1,25 +1,14 @@
echo "==================================== update-versions.ps1 begins ===================================="
echo "Obtaining version information from .\version"
$v=(Get-Content -Path .\version)
echo " version: $v"
echo ""
rm temp.cs -ErrorAction Ignore
rm temp.aip -ErrorAction Ignore
$assemblyInfo="./DesktopEdge/Properties/AssemblyInfo.cs"
$assemblyInfoReplaced="${assemblyInfo}.replaced"
$installer="./Installer/ZitiDesktopEdge.aip"
$installerReplaced="${installer}.replaced"
echo "Replacing version in $assemblyInfo into $assemblyInfoReplaced"
(Get-Content -Encoding UTF8 -path $assemblyInfo -Raw) -replace 'Version\("[0-9]*.[0-9]*.[0-9]*.0', "Version(""${v}.0" | Set-Content -Encoding UTF8 -Path "$assemblyInfoReplaced" -NoNewline
rm $assemblyInfo
mv $assemblyInfoReplaced $assemblyInfo
echo "Replacing version in $installer into $installerReplaced"
(Get-Content -Encoding UTF8 -path $installer -Raw) -replace '"ProductVersion" Value="[0-9]*\.[0-9]*\.[0-9]*"', """ProductVersion"" Value=""${v}""" | Set-Content -Path "${installer}.replaced" -Encoding UTF8 -NoNewline
rm $installer
mv $installerReplaced $installer
echo "==================================== update-versions.ps1 begins ===================================="
echo "Obtaining version information from .\version"
$v=(Get-Content -Path .\version)
echo " version: $v"
echo ""
$assemblyInfo="./DesktopEdge/Properties/AssemblyInfo.cs"
$assemblyInfoReplaced="${assemblyInfo}.replaced"
echo "Replacing version in $assemblyInfo into $assemblyInfoReplaced"
(Get-Content -Encoding UTF8 -path $assemblyInfo -Raw) -replace 'Version\("[0-9]*.[0-9]*.[0-9]*.0', "Version(""${v}.0" | Set-Content -Encoding UTF8 -Path "$assemblyInfoReplaced" -NoNewline
rm $assemblyInfo
mv $assemblyInfoReplaced $assemblyInfo
echo "==================================== update-versions.ps1 complete ===================================="