msi-example: add ARM64 support

Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
Simon Rozman 2020-05-07 08:08:22 +02:00 committed by Jason A. Donenfeld
parent 826c976523
commit e7763f64db
3 changed files with 22 additions and 10 deletions

View File

@ -14,25 +14,33 @@ dependencies. use it as follows below.
#### Steps: #### Steps:
1. Generate a UUID using uuidgen.exe and replace `{{{FIXED 64BIT UUID}}}` in exampletun.wxs 1. Generate a UUID using uuidgen.exe and replace `{{{FIXED AMD64 UUID}}}` in exampletun.wxs
with that UUID. For the life time of your entire product, even across versions, do not change with that UUID. For the life time of your entire product, even across versions, do not change
that UUID. that UUID.
2. Generate another UUID using uuidgen.exe and replace `{{{FIXED 32BIT UUID}}}` in 2. Generate a UUID using uuidgen.exe and replace `{{{FIXED ARM64 UUID}}}` in exampletun.wxs
with that UUID. For the life time of your entire product, even across versions, do not change
that UUID.
3. Generate another UUID using uuidgen.exe and replace `{{{FIXED X86 UUID}}}` in
exampletun.wxs with that UUID. For the life time of your entire product, even across versions, exampletun.wxs with that UUID. For the life time of your entire product, even across versions,
do not change that UUID. do not change that UUID.
3. Go to [Wintun.net](https://www.wintun.net/) and look at what the latest version is (`0.6`, 4. Go to [Wintun.net](https://www.wintun.net/) and look at what the latest version is (`0.6`,
for example). Replace `{{{VERSION}}}` in build.bat with that version. for example). Replace `{{{VERSION}}}` in build.bat with that version.
4. Download the amd64 MSM from [Wintun.net](https://www.wintun.net/) and compute its SHA2-256 5. Download the amd64 MSM from [Wintun.net](https://www.wintun.net/) and compute its SHA2-256
sum in all lowercase hex digits using `CertUtil -hashfile "path/to/file" SHA256`, and replace sum in all lowercase hex digits using `CertUtil -hashfile "path/to/file" SHA256`, and replace
`{{{64BIT HASH}}}` in build.bat with that value. `{{{64BIT HASH}}}` in build.bat with that value.
5. Download the x86 MSM from [Wintun.net](https://www.wintun.net/) and compute its SHA2-256 6. Download the arm64 MSM from [Wintun.net](https://www.wintun.net/) and compute its SHA2-256
sum in all lowercase hex digits using `CertUtil -hashfile "path/to/file" SHA256`, and replace
`{{{64BIT HASH}}}` in build.bat with that value.
7. Download the x86 MSM from [Wintun.net](https://www.wintun.net/) and compute its SHA2-256
sum in all lowercase hex digits using `CertUtil -hashfile "path/to/file" SHA256`, and replace sum in all lowercase hex digits using `CertUtil -hashfile "path/to/file" SHA256`, and replace
`{{{32BIT HASH}}}` in build.bat with that value. `{{{32BIT HASH}}}` in build.bat with that value.
6. Run build.bat. 8. Run build.bat.
7. Distribute dist\exampletun-*.msi for your own software only. 9. Distribute dist\exampletun-*.msi for your own software only.

View File

@ -17,7 +17,8 @@ if exist .deps\prepared goto :build
cd .deps || goto :error cd .deps || goto :error
call :download wintun-x86.msm https://www.wintun.net/builds/wintun-x86-{{{VERSION}}}.msm {{{32BIT HASH}}} || goto :error call :download wintun-x86.msm https://www.wintun.net/builds/wintun-x86-{{{VERSION}}}.msm {{{32BIT HASH}}} || goto :error
call :download wintun-amd64.msm https://www.wintun.net/builds/wintun-amd64-{{{VERSION}}}.msm {{{64BIT HASH}}} || goto :error call :download wintun-amd64.msm https://www.wintun.net/builds/wintun-amd64-{{{VERSION}}}.msm {{{64BIT HASH}}} || goto :error
call :download wix-binaries.zip http://wixtoolset.org/downloads/v3.14.0.2812/wix314-binaries.zip 923892298f37514622c58cbbd9c2cadf2822d9bb53df8ee83aaeb05280777611 || goto :error call :download wintun-arm64.msm https://www.wintun.net/builds/wintun-arm64-{{{VERSION}}}.msm {{{64BIT HASH}}} || goto :error
call :download wix-binaries.zip https://wixtoolset.org/downloads/v3.14.0.3910/wix314-binaries.zip 0904a88a4bcd9dd3c2274caabe73989cd72767ee90c8fa0bf813d004eec90d32 || goto :error
echo [+] Extracting wix-binaries.zip echo [+] Extracting wix-binaries.zip
mkdir wix\bin || goto :error mkdir wix\bin || goto :error
tar -xf wix-binaries.zip -C wix\bin || goto :error tar -xf wix-binaries.zip -C wix\bin || goto :error
@ -30,6 +31,7 @@ if exist .deps\prepared goto :build
set WIX=%BUILDDIR%.deps\wix\ set WIX=%BUILDDIR%.deps\wix\
call :msi x86 x86 || goto :error call :msi x86 x86 || goto :error
call :msi amd64 x64 || goto :error call :msi amd64 x64 || goto :error
call :msi arm64 arm64 || goto :error
if exist ..\sign.bat call ..\sign.bat if exist ..\sign.bat call ..\sign.bat
if "%SigningCertificate%"=="" goto :success if "%SigningCertificate%"=="" goto :success
if "%TimestampServer%"=="" goto :success if "%TimestampServer%"=="" goto :success

View File

@ -5,9 +5,11 @@
Copyright (C) 2019 WireGuard LLC. All Rights Reserved. Copyright (C) 2019 WireGuard LLC. All Rights Reserved.
--> -->
<?if $(var.EXAMPLETUN_PLATFORM) = "amd64"?> <?if $(var.EXAMPLETUN_PLATFORM) = "amd64"?>
<?define UpgradeCode = "{{{FIXED 64BIT UUID}}}"?> <?define UpgradeCode = "{{{FIXED AMD64 UUID}}}"?>
<?elseif $(var.EXAMPLETUN_PLATFORM) = "arm64"?>
<?define UpgradeCode = "{{{FIXED ARM64 UUID}}}"?>
<?elseif $(var.EXAMPLETUN_PLATFORM) = "x86"?> <?elseif $(var.EXAMPLETUN_PLATFORM) = "x86"?>
<?define UpgradeCode = "{{{FIXED 32BIT UUID}}}"?> <?define UpgradeCode = "{{{FIXED X86 UUID}}}"?>
<?else?> <?else?>
<?error Unknown platform ?> <?error Unknown platform ?>
<?endif?> <?endif?>