Skip to content

Commit 703c264

Browse files
committed
Separate x86/x64 and ARM64 installers
1 parent b46883e commit 703c264

14 files changed

+322
-173
lines changed

Diff for: Src/BUILDME.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Visual Studio 2019 (Community Edition is enough)
1010
- Windows 10 SDK (10.0.19041.0) for Desktop C++
1111
- Visual C++ ATL support
1212
HTML Help Workshop
13-
WiX 3.14
13+
WiX 3.7 (3.14 for ARM64)
1414
7-Zip
1515
It is possible to convert the projects to newer versions of Visual Studio and newer SDKs.
1616
Newer versions of WiX will probably work fine.

Diff for: Src/OpenShell.sln

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ Global
151151
{A4A4D3B1-24E7-401E-A37C-72141D7603DC}.Release|Win32.Build.0 = Release|Win32
152152
{A4A4D3B1-24E7-401E-A37C-72141D7603DC}.Release|x64.ActiveCfg = Release|Win32
153153
{A4A4D3B1-24E7-401E-A37C-72141D7603DC}.Release|x64.Build.0 = Release|Win32
154-
{A4A4D3B1-24E7-401E-A37C-72141D7603DC}.Setup|ARM64.ActiveCfg = Release|Win32
154+
{A4A4D3B1-24E7-401E-A37C-72141D7603DC}.Setup|ARM64.ActiveCfg = Release|ARM64
155155
{A4A4D3B1-24E7-401E-A37C-72141D7603DC}.Setup|Win32.ActiveCfg = Release|Win32
156156
{A4A4D3B1-24E7-401E-A37C-72141D7603DC}.Setup|x64.ActiveCfg = Release|Win32
157157
{EA65FDDD-CB77-417F-8BB4-2F3ECB5B3E75}.Debug|ARM64.ActiveCfg = Resource|Win32

Diff for: Src/Setup/BuildArchives.bat

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
REM ***** Collect PDBs
22

33
echo -- Creating symbols package
4-
set CS_SYMBOLS_NAME=OpenShellPDB_%CS_VERSION_STR%.7z
4+
set CS_SYMBOLS_NAME=OpenShellPDB_%CS_VERSION_STR%
5+
if %ARCH%==ARM64 set CS_SYMBOLS_NAME=%CS_SYMBOLS_NAME%_ARM64
6+
set CS_SYMBOLS_NAME=%CS_SYMBOLS_NAME%.7z
57

8+
if exist Final\%CS_SYMBOLS_NAME% del Final\%CS_SYMBOLS_NAME% > nul
69
7z a -mx9 .\Final\%CS_SYMBOLS_NAME% .\Output\symbols\* > nul
710

811
if defined APPVEYOR (

Diff for: Src/Setup/BuildBinaries.bat

+65-55
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ echo -- Compiling
77

88
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set MSBuildDir=%%i\MSBuild\Current\Bin\
99

10-
REM ********* Build ARM64 solution
11-
echo --- ARM64
12-
"%MSBuildDir%MSBuild.exe" ..\OpenShell.sln /m /t:Rebuild /p:Configuration="Setup" /p:Platform="ARM64" /verbosity:quiet /nologo
13-
@if ERRORLEVEL 1 exit /b 1
14-
15-
REM ********* Build x64 solution
16-
echo --- x64
17-
"%MSBuildDir%MSBuild.exe" ..\OpenShell.sln /m /t:Rebuild /p:Configuration="Setup" /p:Platform="x64" /verbosity:quiet /nologo
18-
@if ERRORLEVEL 1 exit /b 1
10+
if %ARCH%==ARM64 (
11+
REM ********* Build ARM64 solution
12+
echo --- ARM64
13+
"%MSBuildDir%MSBuild.exe" ..\OpenShell.sln /m /t:Rebuild /p:Configuration="Setup" /p:Platform="ARM64" /verbosity:quiet /nologo
14+
if ERRORLEVEL 1 exit /b 1
15+
) else (
16+
REM ********* Build x64 solution
17+
echo --- x64
18+
"%MSBuildDir%MSBuild.exe" ..\OpenShell.sln /m /t:Rebuild /p:Configuration="Setup" /p:Platform="x64" /verbosity:quiet /nologo
19+
if ERRORLEVEL 1 exit /b 1
20+
)
1921

2022
REM ********* Build 32-bit solution (must be after 64-bit)
2123
echo --- x86
@@ -48,19 +50,21 @@ copy /B ..\Update\DesktopToasts\Release\DesktopToasts.dll Output > nul
4850
copy /B ..\StartMenu\StartMenuHelper\Setup\StartMenuHelper32.dll Output > nul
4951
copy /B ..\Setup\SetupHelper\Release\SetupHelper.exe Output > nul
5052

51-
copy /B ..\ClassicExplorer\Setup64\ClassicExplorer64.dll Output\x64 > nul
52-
copy /B ..\ClassicIE\Setup64\ClassicIEDLL_64.dll Output\x64 > nul
53-
copy /B ..\ClassicIE\Setup64\ClassicIE_64.exe Output\x64 > nul
54-
copy /B ..\StartMenu\Setup64\StartMenu.exe Output\x64 > nul
55-
copy /B ..\StartMenu\Setup64\StartMenuDLL.dll Output\x64 > nul
56-
copy /B ..\StartMenu\StartMenuHelper\Setup64\StartMenuHelper64.dll Output\x64 > nul
57-
58-
copy /B ..\ClassicExplorer\SetupARM64\ClassicExplorerARM64.dll Output\ARM64 > nul
59-
copy /B ..\ClassicIE\SetupARM64\ClassicIEDLL_ARM64.dll Output\ARM64 > nul
60-
copy /B ..\ClassicIE\SetupARM64\ClassicIE_ARM64.exe Output\ARM64 > nul
61-
copy /B ..\StartMenu\SetupARM64\StartMenu.exe Output\ARM64 > nul
62-
copy /B ..\StartMenu\SetupARM64\StartMenuDLL.dll Output\ARM64 > nul
63-
copy /B ..\StartMenu\StartMenuHelper\SetupARM64\StartMenuHelperARM64.dll Output\ARM64 > nul
53+
if %ARCH%==ARM64 (
54+
copy /B ..\ClassicExplorer\SetupARM64\ClassicExplorerARM64.dll Output\ARM64 > nul
55+
copy /B ..\ClassicIE\SetupARM64\ClassicIEDLL_ARM64.dll Output\ARM64 > nul
56+
copy /B ..\ClassicIE\SetupARM64\ClassicIE_ARM64.exe Output\ARM64 > nul
57+
copy /B ..\StartMenu\SetupARM64\StartMenu.exe Output\ARM64 > nul
58+
copy /B ..\StartMenu\SetupARM64\StartMenuDLL.dll Output\ARM64 > nul
59+
copy /B ..\StartMenu\StartMenuHelper\SetupARM64\StartMenuHelperARM64.dll Output\ARM64 > nul
60+
) else (
61+
copy /B ..\ClassicExplorer\Setup64\ClassicExplorer64.dll Output\x64 > nul
62+
copy /B ..\ClassicIE\Setup64\ClassicIEDLL_64.dll Output\x64 > nul
63+
copy /B ..\ClassicIE\Setup64\ClassicIE_64.exe Output\x64 > nul
64+
copy /B ..\StartMenu\Setup64\StartMenu.exe Output\x64 > nul
65+
copy /B ..\StartMenu\Setup64\StartMenuDLL.dll Output\x64 > nul
66+
copy /B ..\StartMenu\StartMenuHelper\Setup64\StartMenuHelper64.dll Output\x64 > nul
67+
)
6468

6569
copy /B "..\StartMenu\Skins\Classic Skin.skin" Output > nul
6670
copy /B "..\StartMenu\Skins\Full Glass.skin" Output > nul
@@ -89,31 +93,35 @@ copy /B Output\ClassicExplorer32.dll Output\PDB32 > nul
8993
copy /B ..\ClassicExplorer\Setup\ClassicExplorerSettings.pdb Output\PDB32 > nul
9094
copy /B Output\ClassicExplorerSettings.exe Output\PDB32 > nul
9195

92-
REM Explorer x64
93-
copy /B ..\ClassicExplorer\Setup64\ClassicExplorer64.pdb Output\PDBx64 > nul
94-
copy /B Output\x64\ClassicExplorer64.dll Output\PDBx64 > nul
95-
96-
REM Explorer ARM64
97-
copy /B ..\ClassicExplorer\SetupARM64\ClassicExplorerARM64.pdb Output\PDBARM64 > nul
98-
copy /B Output\ARM64\ClassicExplorerARM64.dll Output\PDBARM64 > nul
96+
if %ARCH%==ARM64 (
97+
REM Explorer ARM64
98+
copy /B ..\ClassicExplorer\SetupARM64\ClassicExplorerARM64.pdb Output\PDBARM64 > nul
99+
copy /B Output\ARM64\ClassicExplorerARM64.dll Output\PDBARM64 > nul
100+
) else (
101+
REM Explorer x64
102+
copy /B ..\ClassicExplorer\Setup64\ClassicExplorer64.pdb Output\PDBx64 > nul
103+
copy /B Output\x64\ClassicExplorer64.dll Output\PDBx64 > nul
104+
)
99105

100106
REM IE 32
101107
copy /B ..\ClassicIE\Setup\ClassicIEDLL_32.pdb Output\PDB32 > nul
102108
copy /B Output\ClassicIEDLL_32.dll Output\PDB32 > nul
103109
copy /B ..\ClassicIE\Setup\ClassicIE_32.pdb Output\PDB32 > nul
104110
copy /B Output\ClassicIE_32.exe Output\PDB32 > nul
105111

106-
REM IE x64
107-
copy /B ..\ClassicIE\Setup64\ClassicIEDLL_64.pdb Output\PDBx64 > nul
108-
copy /B Output\x64\ClassicIEDLL_64.dll Output\PDBx64 > nul
109-
copy /B ..\ClassicIE\Setup64\ClassicIE_64.pdb Output\PDBx64 > nul
110-
copy /B Output\x64\ClassicIE_64.exe Output\PDBx64 > nul
111-
112-
REM IE ARM64
113-
copy /B ..\ClassicIE\SetupARM64\ClassicIEDLL_ARM64.pdb Output\PDBARM64 > nul
114-
copy /B Output\ARM64\ClassicIEDLL_ARM64.dll Output\PDBARM64 > nul
115-
copy /B ..\ClassicIE\SetupARM64\ClassicIE_ARM64.pdb Output\PDBARM64 > nul
116-
copy /B Output\ARM64\ClassicIE_ARM64.exe Output\PDBARM64 > nul
112+
if %ARCH%==ARM64 (
113+
REM IE ARM64
114+
copy /B ..\ClassicIE\SetupARM64\ClassicIEDLL_ARM64.pdb Output\PDBARM64 > nul
115+
copy /B Output\ARM64\ClassicIEDLL_ARM64.dll Output\PDBARM64 > nul
116+
copy /B ..\ClassicIE\SetupARM64\ClassicIE_ARM64.pdb Output\PDBARM64 > nul
117+
copy /B Output\ARM64\ClassicIE_ARM64.exe Output\PDBARM64 > nul
118+
) else (
119+
REM IE x64
120+
copy /B ..\ClassicIE\Setup64\ClassicIEDLL_64.pdb Output\PDBx64 > nul
121+
copy /B Output\x64\ClassicIEDLL_64.dll Output\PDBx64 > nul
122+
copy /B ..\ClassicIE\Setup64\ClassicIE_64.pdb Output\PDBx64 > nul
123+
copy /B Output\x64\ClassicIE_64.exe Output\PDBx64 > nul
124+
)
117125

118126
REM Menu 32
119127
copy /B ..\StartMenu\Setup\StartMenu.pdb Output\PDB32 > nul
@@ -127,21 +135,23 @@ copy /B Output\Update.exe Output\PDB32 > nul
127135
copy /B ..\Update\DesktopToasts\Release\DesktopToasts.pdb Output\PDB32 > nul
128136
copy /B Output\DesktopToasts.dll Output\PDB32 > nul
129137

130-
REM Menu x64
131-
copy /B ..\StartMenu\Setup64\StartMenu.pdb Output\PDBx64 > nul
132-
copy /B Output\x64\StartMenu.exe Output\PDBx64 > nul
133-
copy /B ..\StartMenu\Setup64\StartMenuDLL.pdb Output\PDBx64 > nul
134-
copy /B Output\x64\StartMenuDLL.dll Output\PDBx64 > nul
135-
copy /B ..\StartMenu\StartMenuHelper\Setup64\StartMenuHelper64.pdb Output\PDBx64 > nul
136-
copy /B Output\x64\StartMenuHelper64.dll Output\PDBx64 > nul
137-
138-
REM Menu ARM64
139-
copy /B ..\StartMenu\SetupARM64\StartMenu.pdb Output\PDBARM64 > nul
140-
copy /B Output\ARM64\StartMenu.exe Output\PDBARM64 > nul
141-
copy /B ..\StartMenu\SetupARM64\StartMenuDLL.pdb Output\PDBARM64 > nul
142-
copy /B Output\ARM64\StartMenuDLL.dll Output\PDBARM64 > nul
143-
copy /B ..\StartMenu\StartMenuHelper\SetupARM64\StartMenuHelperARM64.pdb Output\PDBARM64 > nul
144-
copy /B Output\ARM64\StartMenuHelperARM64.dll Output\PDBARM64 > nul
138+
if %ARCH%==ARM64 (
139+
REM Menu ARM64
140+
copy /B ..\StartMenu\SetupARM64\StartMenu.pdb Output\PDBARM64 > nul
141+
copy /B Output\ARM64\StartMenu.exe Output\PDBARM64 > nul
142+
copy /B ..\StartMenu\SetupARM64\StartMenuDLL.pdb Output\PDBARM64 > nul
143+
copy /B Output\ARM64\StartMenuDLL.dll Output\PDBARM64 > nul
144+
copy /B ..\StartMenu\StartMenuHelper\SetupARM64\StartMenuHelperARM64.pdb Output\PDBARM64 > nul
145+
copy /B Output\ARM64\StartMenuHelperARM64.dll Output\PDBARM64 > nul
146+
) else (
147+
REM Menu x64
148+
copy /B ..\StartMenu\Setup64\StartMenu.pdb Output\PDBx64 > nul
149+
copy /B Output\x64\StartMenu.exe Output\PDBx64 > nul
150+
copy /B ..\StartMenu\Setup64\StartMenuDLL.pdb Output\PDBx64 > nul
151+
copy /B Output\x64\StartMenuDLL.dll Output\PDBx64 > nul
152+
copy /B ..\StartMenu\StartMenuHelper\Setup64\StartMenuHelper64.pdb Output\PDBx64 > nul
153+
copy /B Output\x64\StartMenuHelper64.dll Output\PDBx64 > nul
154+
)
145155

146156
REM ********* Source Index PDBs
147157

Diff for: Src/Setup/BuildInstaller.bat

+48-38
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ echo -- Building Installer (%CS_LANG_NAME_SHORT%)
2424

2525
SET CS_INSTALLER_NAME=OpenShellSetup_%CS_VERSION_STR%-%CS_LANG_NAME_SHORT%
2626
if %CS_LANG_NAME_SHORT%==en SET CS_INSTALLER_NAME=OpenShellSetup_%CS_VERSION_STR%
27+
if %ARCH%==ARM64 SET CS_INSTALLER_NAME=%CS_INSTALLER_NAME%_ARM64
28+
29+
SET CS_SETUP_ARCH=Win32
30+
if %ARCH%==ARM64 SET CS_SETUP_ARCH=ARM64
31+
32+
SET CS_SETUP_DIR=Release
33+
if %ARCH%==ARM64 SET CS_SETUP_DIR=%CS_SETUP_DIR%ARM64
2734

2835
if exist Temp rd /Q /S Temp
2936
md Temp
@@ -36,58 +43,61 @@ md Temp
3643
@set /a "CS_VERSION_NUM=%%A<<24|%%B<<16|%%C"
3744
)
3845

39-
REM ********* Build x86 MSI
40-
echo --- x86 MSI
41-
candle Setup.wxs -nologo -out Temp\Setup32.wixobj -ext WixUIExtension -ext WixUtilExtension -dx64=0 -dARM64=0 -dCS_LANG_FOLDER=%CS_LANG_FOLDER% -dCS_LANG_NAME=%CS_LANG_NAME%
42-
@if ERRORLEVEL 1 exit /b 1
43-
44-
@REM We need to suppress ICE38 and ICE43 because they apply only to per-user installation. We only support per-machine installs
45-
@REM We need to suppress ICE09 because the helper DLLs need to go into the system directory (for safety reasons)
46-
light Temp\Setup32.wixobj -nologo -out Temp\Setup32.msi -ext WixUIExtension -ext WixUtilExtension -loc ..\Localization\%CS_LANG_FOLDER%\OpenShellText-%CS_LANG_NAME%.wxl -loc ..\Localization\%CS_LANG_FOLDER%\WixUI_%CS_LANG_NAME%.wxl -sice:ICE38 -sice:ICE43 -sice:ICE09
47-
@if ERRORLEVEL 1 exit /b 1
48-
49-
50-
REM ********* Build x64 MSI
51-
echo --- x64 MSI
52-
candle Setup.wxs -nologo -out Temp\Setup64.wixobj -ext WixUIExtension -ext WixUtilExtension -dx64=1 -dARM64=0 -dCS_LANG_FOLDER=%CS_LANG_FOLDER% -dCS_LANG_NAME=%CS_LANG_NAME%
53-
@if ERRORLEVEL 1 exit /b 1
54-
55-
@REM We need to suppress ICE38 and ICE43 because they apply only to per-user installation. We only support per-machine installs
56-
@REM We need to suppress ICE09 because the helper DLLs need to go into the system directory (for safety reasons)
57-
light Temp\Setup64.wixobj -nologo -out Temp\Setup64.msi -ext WixUIExtension -ext WixUtilExtension -loc ..\Localization\%CS_LANG_FOLDER%\OpenShellText-%CS_LANG_NAME%.wxl -loc ..\Localization\%CS_LANG_FOLDER%\WixUI_%CS_LANG_NAME%.wxl -sice:ICE38 -sice:ICE43 -sice:ICE09
58-
@if ERRORLEVEL 1 exit /b 1
59-
60-
61-
REM ********* Build ARM64 MSI
62-
echo --- ARM64 MSI
63-
candle Setup.wxs -nologo -out Temp\SetupARM64.wixobj -ext WixUIExtension -ext WixUtilExtension -dx64=0 -dARM64=1 -dCS_LANG_FOLDER=%CS_LANG_FOLDER% -dCS_LANG_NAME=%CS_LANG_NAME%
64-
@if ERRORLEVEL 1 exit /b 1
65-
66-
@REM We need to suppress ICE38 and ICE43 because they apply only to per-user installation. We only support per-machine installs
67-
@REM We need to suppress ICE09 because the helper DLLs need to go into the system directory (for safety reasons)
68-
light Temp\SetupARM64.wixobj -nologo -out Temp\SetupARM64.msi -ext WixUIExtension -ext WixUtilExtension -loc ..\Localization\%CS_LANG_FOLDER%\OpenShellText-%CS_LANG_NAME%.wxl -loc ..\Localization\%CS_LANG_FOLDER%\WixUI_%CS_LANG_NAME%.wxl -sice:ICE38 -sice:ICE43 -sice:ICE09
69-
@if ERRORLEVEL 1 exit /b 1
70-
46+
if %ARCH%==ARM64 (
47+
REM ********* Build ARM64 MSI
48+
echo --- ARM64 MSI
49+
candle Setup.wxs -nologo -out Temp\SetupARM64.wixobj -ext WixUIExtension -ext WixUtilExtension -dx64=0 -dARM64=1 -dCS_LANG_FOLDER=%CS_LANG_FOLDER% -dCS_LANG_NAME=%CS_LANG_NAME%
50+
if ERRORLEVEL 1 exit /b 1
51+
52+
REM We need to suppress ICE38 and ICE43 because they apply only to per-user installation. We only support per-machine installs
53+
REM We need to suppress ICE09 because the helper DLLs need to go into the system directory (for safety reasons)
54+
light Temp\SetupARM64.wixobj -nologo -out Temp\SetupARM64.msi -ext WixUIExtension -ext WixUtilExtension -loc ..\Localization\%CS_LANG_FOLDER%\OpenShellText-%CS_LANG_NAME%.wxl -loc ..\Localization\%CS_LANG_FOLDER%\WixUI_%CS_LANG_NAME%.wxl -sice:ICE38 -sice:ICE43 -sice:ICE09
55+
if ERRORLEVEL 1 exit /b 1
56+
) else (
57+
REM ********* Build x86 MSI
58+
echo --- x86 MSI
59+
candle Setup.wxs -nologo -out Temp\Setup32.wixobj -ext WixUIExtension -ext WixUtilExtension -dx64=0 -dARM64=0 -dCS_LANG_FOLDER=%CS_LANG_FOLDER% -dCS_LANG_NAME=%CS_LANG_NAME%
60+
if ERRORLEVEL 1 exit /b 1
61+
62+
REM We need to suppress ICE38 and ICE43 because they apply only to per-user installation. We only support per-machine installs
63+
REM We need to suppress ICE09 because the helper DLLs need to go into the system directory (for safety reasons)
64+
light Temp\Setup32.wixobj -nologo -out Temp\Setup32.msi -ext WixUIExtension -ext WixUtilExtension -loc ..\Localization\%CS_LANG_FOLDER%\OpenShellText-%CS_LANG_NAME%.wxl -loc ..\Localization\%CS_LANG_FOLDER%\WixUI_%CS_LANG_NAME%.wxl -sice:ICE38 -sice:ICE43 -sice:ICE09
65+
if ERRORLEVEL 1 exit /b 1
66+
67+
REM ********* Build x64 MSI
68+
echo --- x64 MSI
69+
candle Setup.wxs -nologo -out Temp\Setup64.wixobj -ext WixUIExtension -ext WixUtilExtension -dx64=1 -dARM64=0 -dCS_LANG_FOLDER=%CS_LANG_FOLDER% -dCS_LANG_NAME=%CS_LANG_NAME%
70+
if ERRORLEVEL 1 exit /b 1
71+
72+
REM We need to suppress ICE38 and ICE43 because they apply only to per-user installation. We only support per-machine installs
73+
REM We need to suppress ICE09 because the helper DLLs need to go into the system directory (for safety reasons)
74+
light Temp\Setup64.wixobj -nologo -out Temp\Setup64.msi -ext WixUIExtension -ext WixUtilExtension -loc ..\Localization\%CS_LANG_FOLDER%\OpenShellText-%CS_LANG_NAME%.wxl -loc ..\Localization\%CS_LANG_FOLDER%\WixUI_%CS_LANG_NAME%.wxl -sice:ICE38 -sice:ICE43 -sice:ICE09
75+
if ERRORLEVEL 1 exit /b 1
76+
)
7177

7278
REM ********* Build MSI Checksums
7379
echo --- MSI Checksums
74-
Utility\Release\Utility.exe crcmsi Temp
80+
if %ARCH%==ARM64 (
81+
Utility\Release\Utility.exe crcarm64msi Temp
82+
) else (
83+
Utility\Release\Utility.exe crcmsi Temp
84+
)
7585
@if ERRORLEVEL 1 exit /b 1
7686

7787
REM ********* Build bootstrapper
7888
echo --- Bootstrapper
7989
for /f "usebackq tokens=*" %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -requires Microsoft.Component.MSBuild -property installationPath`) do set MSBuildDir=%%i\MSBuild\Current\Bin\
8090

81-
"%MSBuildDir%MSBuild.exe" Setup.sln /m /t:Rebuild /p:Configuration="Release" /p:Platform="Win32" /verbosity:quiet /nologo
91+
"%MSBuildDir%MSBuild.exe" Setup.sln /m /t:Rebuild /p:Configuration="Release" /p:Platform="%CS_SETUP_ARCH%" /verbosity:quiet /nologo
8292
@if ERRORLEVEL 1 exit /b 1
8393

84-
if exist Final rd /Q /S Final
85-
md Final
94+
if exist Final\%CS_INSTALLER_NAME%.exe del Final\%CS_INSTALLER_NAME%.exe > nul
95+
md Final 1> nul 2>&1
8696

87-
copy /B Release\Setup.exe Final\%CS_INSTALLER_NAME%.exe > nul
97+
copy /B %CS_SETUP_DIR%\Setup.exe Final\%CS_INSTALLER_NAME%.exe > nul
8898

8999
if defined APPVEYOR (
90-
appveyor PushArtifact Release\Setup.exe -FileName %CS_INSTALLER_NAME%.exe
100+
appveyor PushArtifact %CS_SETUP_DIR%\Setup.exe -FileName %CS_INSTALLER_NAME%.exe
91101
)
92102

93103
SET CS_LANG_FOLDER=

Diff for: Src/Setup/Setup.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include "StringUtils.h"
1313
#include "FNVHash.h"
1414

15-
// Setup.exe is a bootstrap application that contains installers for x86, x64 and ARM64.
15+
// Setup.exe is a bootstrap application that contains installers for x86 and x64 or ARM64.
1616
// It unpacks the right installer into the temp directory and executes it.
1717

1818
typedef BOOL (WINAPI *FIsWow64Process)( HANDLE hProcess, PBOOL Wow64Process );
@@ -81,13 +81,13 @@ static int ExtractMsi( HINSTANCE hInstance, const wchar_t *msiName, ExtractType
8181
}
8282
return ERR_HASH_NOTFOUND;
8383
}
84-
unsigned int hash0=((unsigned int*)pRes)[extractType==ARM64?2:extractType==x64?1:0];
84+
unsigned int hash0=((unsigned int*)pRes)[extractType==x64?1:0];
8585
const Chunk *pChunks=NULL;
8686
int chunkCount=0;
8787
if (extractType==x64)
8888
{
89-
chunkCount=((unsigned int*)pRes)[3];
90-
pChunks=(Chunk*)((unsigned int*)pRes+4);
89+
chunkCount=((unsigned int*)pRes)[2];
90+
pChunks=(Chunk*)((unsigned int*)pRes+3);
9191
}
9292

9393
// extract the installer
@@ -98,7 +98,7 @@ static int ExtractMsi( HINSTANCE hInstance, const wchar_t *msiName, ExtractType
9898
HGLOBAL hRes=LoadResource(hInstance,hResInfo);
9999
pRes32=(unsigned char*)LockResource(hRes);
100100
}
101-
if (!pRes32)
101+
if (!pRes32 && extractType!=ARM64)
102102
{
103103
if (!bQuiet)
104104
{
@@ -340,9 +340,10 @@ int APIENTRY wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCm
340340

341341
// Use IsWow64Process2 if it's available (Windows 10 1511+), otherwise fall back to IsWow64Process
342342
FIsWow64Process2 isWow64Process2=(FIsWow64Process2)GetProcAddress(hKernel32,"IsWow64Process2");
343+
USHORT processMachine = 0;
343344
if (isWow64Process2)
344345
{
345-
USHORT processMachine = 0, nativeMachine = 0;
346+
USHORT nativeMachine = 0;
346347
isWow64Process2(GetCurrentProcess(), &processMachine, &nativeMachine);
347348
extractType=nativeMachine==IMAGE_FILE_MACHINE_AMD64?x64:nativeMachine==IMAGE_FILE_MACHINE_ARM64?ARM64:x86;
348349
}
@@ -373,15 +374,15 @@ int APIENTRY wWinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCm
373374

374375
// On ARM64 we must launch msiexec.exe from system32 and not syswow64 as would otherwise happen
375376
PVOID wow64FsRedirVal=NULL;
376-
if (extractType == ARM64)
377+
if (extractType == ARM64 && processMachine != IMAGE_FILE_MACHINE_ARM64)
377378
Wow64DisableWow64FsRedirection(&wow64FsRedirVal);
378379

379380
// start the installer
380381
STARTUPINFO startupInfo={sizeof(startupInfo)};
381382
PROCESS_INFORMATION processInfo;
382383
memset(&processInfo,0,sizeof(processInfo));
383384
BOOL ret=CreateProcess(NULL,cmdLine,NULL,NULL,TRUE,0,NULL,NULL,&startupInfo,&processInfo);
384-
if (extractType == ARM64)
385+
if (extractType == ARM64 && processMachine != IMAGE_FILE_MACHINE_ARM64)
385386
Wow64RevertWow64FsRedirection(wow64FsRedirVal);
386387
if (!ret)
387388
{

Diff for: Src/Setup/Setup.rc

+3
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,12 @@ END
100100
// MSI_FILE
101101
//
102102

103+
#if defined(_M_AMD64) || defined(_M_IX86)
103104
IDR_MSI_FILE32 MSI_FILE "Temp\\Setup32.msi_"
104105
IDR_MSI_FILE64 MSI_FILE "Temp\\Setup64.msi_"
106+
#elif defined(_M_ARM64)
105107
IDR_MSI_FILEARM64 MSI_FILE "Temp\\SetupARM64.msi_"
108+
#endif
106109
IDR_MSI_CHECKSUM MSI_FILE "msichecksum.bin"
107110

108111

0 commit comments

Comments
 (0)