Skip to content

Commit e93dd32

Browse files
committed
Align WiX3 patchable installer inputs with modernization
* Update WiX 3 bundles and framework sources for build-arch handling in BaseInstallerBuild. * Adjust build scripts to pass BuildArch and resolve WiX tool discovery in setVars. * Refresh common WiX includes (custom components/features/overrides/redistributables/fonts). * Refresh installer resources (icons/license) to match current assets. fix: Improve installer custom actions and add manifest files Fix null reference errors in VerifyDataPath custom action and add missing manifest files to installer packaging. - Add null checks for REGISTRYDATAKEY/REGISTRYDATAVALUENAME properties - Add null-safe registry value access to prevent NullReferenceException - Move CloseApplications to InstallUISequence (UI-only, immediate mode) - Add FieldWorks.exe.manifest, FwKernel.X.manifest, Views.X.manifest - Set LaunchUnicodeCharEditor Return="check" to catch manifest errors - Suppress light.exe ICE warnings 1055/1056 for cleaner builds It's FieldWorks.exe, not Flex.exe. Fix name
1 parent 09e75db commit e93dd32

16 files changed

Lines changed: 1170 additions & 160 deletions

BaseInstallerBuild/Bundle.wxs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<WixVariable Id="WixStdbaThemeXml" Value="BundleTheme.xml" />
2323
<WixVariable Id="WixStdbaThemeWxl" Value="BundleTheme.wxl" />
2424
<Chain>
25-
<PackageGroupRef Id="NetFx48Web" />
25+
<PackageGroupRef Id="FwNetFx48Web" />
2626
<PackageGroupRef Id="vcredists" />
2727
<RollbackBoundary />
2828
<PackageGroupRef Id='AppPackageGroup'/>
@@ -53,8 +53,8 @@
5353
<WixVariable Id="NetFx48WebInstallCondition" Value="" Overridable="yes" />
5454
<WixVariable Id="NetFx48WebPackageDirectory" Value="redist\" Overridable="yes" />
5555

56-
<PackageGroup Id="NetFx48Web">
57-
<ExePackage Id="NetFx48Web"
56+
<PackageGroup Id="FwNetFx48Web">
57+
<ExePackage Id="FwNetFx48Web"
5858
InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx48FullLog].html&quot;"
5959
RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx48FullLog].html&quot;"
6060
UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx48FullLog].html&quot;"
@@ -78,7 +78,7 @@
7878
</PackageGroup>
7979
</Fragment>
8080

81-
<?if $(sys.BUILDARCH)="x86"?>
81+
<?if $(var.BuildArch)="x86"?>
8282
<!-- 32bit VC++ redistributable download section -->
8383
<!-- When updating or adding a redistributable you can generate the RemotePayload with the WIX's heat tool -->
8484
<!-- e.g. "%WIX%\bin\heat" payload C:\fwroot\fw\PatchableInstaller\libs\vcredist_2008_x64.exe -o c:\Repositories\fw\PatchableInstaller\VC2008Frag.wxs -->
@@ -200,7 +200,7 @@
200200
</ExePackage>
201201
</PackageGroup>
202202
</Fragment>
203-
<?elseif $(sys.BUILDARCH)="x64"?>
203+
<?elseif $(var.BuildArch)="x64"?>
204204
<!-- 64bit VC++ redistributable download section -->
205205
<!-- When updating or adding a redistributable you can generate the RemotePayload with the WIX's heat tool -->
206206
<!-- e.g. "%WIX%\bin\heat" payload C:\fwroot\fw\PatchableInstaller\libs\vcredist_2008_x64.exe -o c:\Repositories\fw\PatchableInstaller\VC2008Frag.wxs -->
@@ -334,7 +334,7 @@
334334
DownloadUrl="$(var.VC15to19RedistWebLink)"
335335
InstallCommand="/quiet /norestart"
336336
DetectCondition="!(wix.CPP14DetectCondition)">
337-
<RemotePayload
337+
<RemotePayload
338338
Size="25169400"
339339
Version="14.29.30040.0"
340340
ProductName="Microsoft Visual C++ 2015-2019 Redistributable (x64) - 14.28.29914"
@@ -345,7 +345,7 @@
345345
</PackageGroup>
346346
</Fragment>
347347
<?else?>
348-
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
348+
<?error Unsupported value of BuildArch=$(var.BuildArch)?>
349349
<?endif?>
350350
<?include ../Common/Redistributables.wxi?>
351351
</Wix>

BaseInstallerBuild/Framework.wxs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0"?>
2-
<?if $(sys.BUILDARCH) = x64?>
2+
<?if $(var.BuildArch) = x64?>
33
<?define PFDir = ProgramFiles64Folder?>
44
<?define CFDir = CommonFiles64Folder?>
55
<?else?>
@@ -68,6 +68,8 @@
6868

6969
<CustomAction Id="CloseApplications"
7070
Return="check"
71+
Execute="immediate"
72+
Impersonate="yes"
7173
BinaryKey="MyCustomActionsDll"
7274
DllEntry="ClosePrompt" />
7375
<!-- The following two properties can be comma separted lists, but they must have the same number of items. -->
@@ -101,6 +103,8 @@
101103
<SetProperty Id='APPFOLDERREGSZNAME' Value='Program_Files_Directory_$(var.SafeApplicationName)' Before="AppSearch">not APPFOLDERREGSZNAME</SetProperty>
102104
<SetProperty Id='DATAFOLDERREGSZNAME' Value='Settings_Directory' Before="AppSearch">not DATAFOLDERREGSZNAME</SetProperty>
103105
<SetProperty Id='HARVESTDATAFOLDERREGSZNAME' Value='Data_Directory' Before="AppSearch">not HARVESTDATAFOLDERREGSZNAME</SetProperty>
106+
<SetProperty Id='REGISTRYDATAKEY' Value='[REGISTRYKEY]' Before="AppSearch">not REGISTRYDATAKEY</SetProperty>
107+
<SetProperty Id='REGISTRYDATAVALUENAME' Value='[DATAFOLDERREGSZNAME]' Before="AppSearch">not REGISTRYDATAVALUENAME</SetProperty>
104108
<CustomAction Id='UseDefDataFolder' Property='DATAFOLDER' Value='[DEFDATAFOLDER]' />
105109
<CustomAction Id='UseOvrDataFolder' Property='DATAFOLDER' Value='[OVRDATAFOLDER]' /> <!-- from Overrides.wxi -->
106110
<CustomAction Id='UseRegDataFolder' Property='DATAFOLDER' Value='[REGDATAFOLDER]' />
@@ -115,7 +119,6 @@
115119
<CustomAction Id='CheckPatchValue' Property='ISPATCH' Value='True' />
116120

117121
<InstallExecuteSequence>
118-
<Custom Action="CloseApplications" Before="AppSearch"></Custom>
119122
<!--<Custom Action="SetFontValues" After="AppSearch"></Custom>-->
120123
<Custom Action="DeleteRegistryVersionNumber" Before="RemoveRegistryValues">(NOT UPGRADINGPRODUCTCODE) AND (REMOVE="ALL")</Custom>
121124
<RemoveExistingProducts Before="InstallInitialize" />
@@ -127,8 +130,9 @@
127130
</InstallExecuteSequence>
128131

129132
<InstallUISequence>
133+
<Custom Action="CloseApplications" Before="AppSearch">UILevel &gt;= 3</Custom>
130134
<Custom Action="SetDefDataFolder" After="FindRelatedProducts"></Custom>
131-
<Custom Action="VerifyDataPath" After="SetDefDataFolder"></Custom>
135+
<Custom Action="VerifyDataPath" After="AppSearch"></Custom>
132136
<Custom Action="UseDefAppFolder" After="AppSearch">(NOT REGAPPFOLDER) and (NOT OVRAPPFOLDER)</Custom>
133137
<Custom Action="UseOvrAppFolder" After="AppSearch">(NOT REGAPPFOLDER) and (OVRAPPFOLDER)</Custom>
134138
<Custom Action="UseRegAppFolder" After="AppSearch">REGAPPFOLDER</Custom>

BaseInstallerBuild/OfflineBundle.wxs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<WixVariable Id="WixStdbaThemeXml" Value="BundleTheme.xml" />
2323
<WixVariable Id="WixStdbaThemeWxl" Value="BundleTheme.wxl" />
2424
<Chain>
25-
<PackageGroupRef Id="NetFx48Redist" />
25+
<PackageGroupRef Id="FwNetFx48Redist" />
2626
<PackageGroupRef Id="vcredists" />
2727
<RollbackBoundary />
2828
<PackageGroupRef Id='AppPackageGroup'/>
@@ -50,8 +50,8 @@
5050
Value="(Netfx4FullRelease &gt;= $(var.NetFx48MinRelease)) AND (NOT VersionNT64 OR (Netfx4x64FullRelease &gt;= $(var.NetFx48MinRelease)))" />
5151
<WixVariable Id="NetFx48RedistInstallCondition" Value="" Overridable="yes" />
5252

53-
<PackageGroup Id="NetFx48Redist">
54-
<ExePackage Id="NetFx48Redist"
53+
<PackageGroup Id="FwNetFx48Redist">
54+
<ExePackage Id="FwNetFx48Redist"
5555
InstallCommand="/q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx48FullLog].html&quot;"
5656
RepairCommand="/q /norestart /repair /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx48FullLog].html&quot;"
5757
UninstallCommand="/uninstall /q /norestart /ChainingPackage &quot;[WixBundleName]&quot; /log &quot;[NetFx48FullLog].html&quot;"
@@ -72,7 +72,7 @@
7272
</ExePackage>
7373
</PackageGroup>
7474
</Fragment>
75-
<?if $(sys.BUILDARCH)="x86"?>
75+
<?if $(var.BuildArch)="x86"?>
7676
<Fragment>
7777
<Property Id="CRVSINSTALLED">
7878
</Property>
@@ -160,7 +160,7 @@
160160
</ExePackage>
161161
</PackageGroup>
162162
</Fragment>
163-
<?elseif $(sys.BUILDARCH)="x64"?>
163+
<?elseif $(var.BuildArch)="x64"?>
164164
<!-- Some 64-bit runtimes register themselves in the 32-bit space.
165165
Check for Runtimes\X64 or similar under each space; if either exists, the 64-bit redistributable is installed. -->
166166
<Fragment>
@@ -278,7 +278,7 @@
278278
</PackageGroup>
279279
</Fragment>
280280
<?else?>
281-
<?error Unsupported value of sys.BUILDARCH=$(sys.BUILDARCH)?>
281+
<?error Unsupported value of BuildArch=$(var.BuildArch)?>
282282
<?endif?>
283283
<?include ../Common/Redistributables.wxi?>
284284
</Wix>

BaseInstallerBuild/buildExe.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ call setVars.bat %*
33

44
REM build the ONLINE EXE bundle.
55
(
6-
candle.exe -v -arch %Arch% -dApplicationName=%AppName% -dSafeApplicationName=%SafeAppName% -dYear=%CopyrightYear% -dManufacturer=%Manufacturer% -dSafeManufacturer=%SafeManufacturer% -dVersionNumber=%Version% -dUpgradeCode=%UPGRADECODEGUID% -dTruncatedVersion=%TRUNCATEDVERSION% -ext WixFirewallExtension -ext WixUtilExtension -ext WixBalExtension -ext WixUIExtension -ext WixNetFxExtension -ext WixDependencyExtension Bundle.wxs
6+
candle.exe -v -arch %Arch% -dBuildArch=%Arch% -dApplicationName=%AppName% -dSafeApplicationName=%SafeAppName% -dYear=%CopyrightYear% -dManufacturer=%Manufacturer% -dSafeManufacturer=%SafeManufacturer% -dVersionNumber=%Version% -dUpgradeCode=%UPGRADECODEGUID% -dTruncatedVersion=%TRUNCATEDVERSION% -ext WixFirewallExtension -ext WixUtilExtension -ext WixBalExtension -ext WixUIExtension -ext WixNetFxExtension -ext WixDependencyExtension Bundle.wxs
77
) && (
88
light.exe -v Bundle.wixobj -ext WixFirewallExtension -ext WixUIExtension -ext WixBalExtension -ext WixUtilExtension -ext WixNetFxExtension -ext WixDependencyExtension %SuppressICE% -out %SafeAppName%_%Version%_Online.exe
99
) && (
1010
@REM build the OFFLINE EXE bundle.
11-
candle.exe -v -arch %Arch% -dApplicationName=%AppName% -dSafeApplicationName=%SafeAppName% -dYear=%CopyrightYear% -dManufacturer=%Manufacturer% -dSafeManufacturer=%SafeManufacturer% -dVersionNumber=%Version% -dUpgradeCode=%UPGRADECODEGUID% -dTruncatedVersion=%TRUNCATEDVERSION% -ext WixFirewallExtension -ext WixUtilExtension -ext WixBalExtension -ext WixUIExtension -ext WixNetFxExtension -ext WixDependencyExtension OfflineBundle.wxs
11+
candle.exe -v -arch %Arch% -dBuildArch=%Arch% -dApplicationName=%AppName% -dSafeApplicationName=%SafeAppName% -dYear=%CopyrightYear% -dManufacturer=%Manufacturer% -dSafeManufacturer=%SafeManufacturer% -dVersionNumber=%Version% -dUpgradeCode=%UPGRADECODEGUID% -dTruncatedVersion=%TRUNCATEDVERSION% -ext WixFirewallExtension -ext WixUtilExtension -ext WixBalExtension -ext WixUIExtension -ext WixNetFxExtension -ext WixDependencyExtension OfflineBundle.wxs
1212
) && (
1313
light.exe -v OfflineBundle.wixobj -ext WixFirewallExtension -ext WixUIExtension -ext WixBalExtension -ext WixUtilExtension -ext WixNetFxExtension -ext WixDependencyExtension %SuppressICE% -out %SafeAppName%_%Version%_Offline.exe
1414
) && (

BaseInstallerBuild/buildMsi.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ call setVars.bat %*
1313
heat.exe dir %MASTERDATADIR% -cg HarvestedDataFiles -gg -scom -sreg -sfrag -srd -sw5150 -sw5151 -dr HARVESTDATAFOLDER -var var.MASTERDATADIR -t KeyPathFix.xsl -out DataHarvest.wxs
1414
) && (
1515
@REM Compile (candle) and Link (light) the MSI file.
16-
candle.exe -arch %Arch% -dApplicationName=%AppName% -dSafeApplicationName=%SafeAppName% -dManufacturer=%Manufacturer% -dSafeManufacturer=%SafeManufacturer% -dVersionNumber=%Version% -dMajorVersion=%Major% -dMinorVersion=%Minor% -dMASTERBUILDDIR=%MASTERBUILDDIR% -dMASTERDATADIR=%MASTERDATADIR% -dUpgradeCode=%UPGRADECODEGUID% -dProductCode=%PRODUCTIDGUID% Framework.wxs AppHarvest.wxs DataHarvest.wxs WixUI_DialogFlow.wxs GIInstallDirDlg.wxs GIProgressDlg.wxs GIWelcomeDlg.wxs GICustomizeDlg.wxs GISetupTypeDlg.wxs -ext WixFirewallExtension -ext WixUtilExtension
16+
candle.exe -arch %Arch% -dBuildArch=%Arch% -dApplicationName=%AppName% -dSafeApplicationName=%SafeAppName% -dManufacturer=%Manufacturer% -dSafeManufacturer=%SafeManufacturer% -dVersionNumber=%Version% -dMajorVersion=%Major% -dMinorVersion=%Minor% -dMASTERBUILDDIR=%MASTERBUILDDIR% -dMASTERDATADIR=%MASTERDATADIR% -dUpgradeCode=%UPGRADECODEGUID% -dProductCode=%PRODUCTIDGUID% Framework.wxs AppHarvest.wxs DataHarvest.wxs WixUI_DialogFlow.wxs GIInstallDirDlg.wxs GIProgressDlg.wxs GIWelcomeDlg.wxs GICustomizeDlg.wxs GISetupTypeDlg.wxs -ext WixFirewallExtension -ext WixUtilExtension
1717
) && (
18-
light.exe Framework.wixobj AppHarvest.wixobj DataHarvest.wixobj WixUI_DialogFlow.wixobj GIInstallDirDlg.wixobj GIProgressDlg.wixobj GIWelcomeDlg.wixobj GICustomizeDlg.wixobj GISetupTypeDlg.wixobj -ext WixFirewallExtension -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -loc WixUI_en-us.wxl %SuppressICE% -sw1076 -out %SafeAppName%_%Version%.msi
18+
light.exe Framework.wixobj AppHarvest.wixobj DataHarvest.wixobj WixUI_DialogFlow.wixobj GIInstallDirDlg.wixobj GIProgressDlg.wixobj GIWelcomeDlg.wixobj GICustomizeDlg.wixobj GISetupTypeDlg.wixobj -ext WixFirewallExtension -ext WixUIExtension -ext WixUtilExtension -cultures:en-us -loc WixUI_en-us.wxl %SuppressICE% -sw1076 -sw1055 -sw1056 -out %SafeAppName%_%Version%.msi
1919
) && (
2020
call signingProxy %CD%\%SafeAppName%_%Version%.msi
2121
)

BaseInstallerBuild/setVars.bat

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,13 @@ REM For some reason, ICE08 works without admin, and the quickest way to suppress
3939
C:\Windows\System32\whoami /groups | find "BUILTIN\Administrators" > nul 2> nul
4040
if errorlevel 1 set SuppressICE=-ice:ICE08
4141

42+
REM Default WIX if not already set
43+
if "%WIX%"=="" if exist "%LOCALAPPDATA%\FieldWorksTools\Wix314\heat.exe" set WIX=%LOCALAPPDATA%\FieldWorksTools\Wix314
44+
4245
REM Ensure WiX tools are on the PATH
4346
where heat >nul 2>nul
44-
if not %errorlevel% == 0 set PATH=%WIX%/bin;%PATH%
47+
if not %errorlevel% == 0 if exist "%WIX%\bin\heat.exe" set PATH=%WIX%\bin;%PATH%
48+
if not %errorlevel% == 0 if not exist "%WIX%\bin\heat.exe" set PATH=%WIX%;%PATH%
4549

4650
REM single quotes, since we expect %msbuild% is already double giquoted
4751
if '%msbuild%' == '' set msbuild=msbuild

Common/CustomActionSteps.wxi

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<Include>
3-
<!-- Must be paired with an <CustomAction Id='LaunchFile'..> in Overrides.wxi -->
4-
<!-- <Custom Action='LaunchFile' After='InstallFinalize'>NOT Installed</Custom> -->
3+
<Custom Action='LaunchUnicodeCharEditor' After='InstallFinalize'>NOT Installed</Custom>
54
</Include>

0 commit comments

Comments
 (0)