Skip to content

Commit 761c64b

Browse files
committed
First installer that kind of works
- it installs fine but the UI is messed up
1 parent c030b0e commit 761c64b

File tree

13 files changed

+985
-200
lines changed

13 files changed

+985
-200
lines changed

Build/Installer.targets

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
<SafeApplicationName Condition="'$(SafeApplicationName)'==''">FieldWorks</SafeApplicationName>
2222
<Manufacturer Condition="'$(Manufacturer)'==''">SIL International</Manufacturer>
2323
<SafeManufacturer Condition="'$(SafeManufacturer)'==''">SIL</SafeManufacturer>
24+
<BundleId Condition="'$(BundleId)'==''">$(SafeManufacturer).$(SafeApplicationName)</BundleId>
2425
<UpgradeCode Condition="'$(UpgradeCode)'==''">1092269F-9EA1-419B-8685-90203F83E254</UpgradeCode>
2526
<BuildVersionSegment Condition="'$(BuildVersionSegment)'==''">1</BuildVersionSegment>
2627
<Year Condition="'$(Year)'==''">$([System.DateTime]::Now.Year)</Year>
@@ -50,7 +51,13 @@
5051
<MSBuild
5152
Projects="$(MSBuildProjectDirectory)\..\FLExInstaller\FieldWorks.Bundle.wixproj"
5253
Targets="Restore;Build"
53-
Properties="Configuration=$(Configuration);Platform=x64;AppBuildDir=$(AppBuildDir);BinDirSuffix=$(BinDirSuffix);DataDirSuffix=$(DataDirSuffix);ApplicationName=$(ApplicationName);SafeApplicationName=$(SafeApplicationName);Manufacturer=$(Manufacturer);UpgradeCode=$(UpgradeCode);VersionNumber=$(VersionNumber);TruncatedVersion=$(TruncatedVersion);Year=$(Year);MajorVersion=$(MajorVersion)"
54+
Properties="Configuration=$(Configuration);Platform=x64;AppBuildDir=$(AppBuildDir);BinDirSuffix=$(BinDirSuffix);DataDirSuffix=$(DataDirSuffix);ApplicationName=$(ApplicationName);SafeApplicationName=$(SafeApplicationName);Manufacturer=$(Manufacturer);SafeManufacturer=$(SafeManufacturer);BundleId=$(BundleId);UpgradeCode=$(UpgradeCode);VersionNumber=$(VersionNumber);TruncatedVersion=$(TruncatedVersion);Year=$(Year);MajorVersion=$(MajorVersion)"
55+
/>
56+
57+
<MSBuild
58+
Projects="$(MSBuildProjectDirectory)\..\FLExInstaller\FieldWorks.OfflineBundle.wixproj"
59+
Targets="Restore;Build"
60+
Properties="Configuration=$(Configuration);Platform=x64;AppBuildDir=$(AppBuildDir);BinDirSuffix=$(BinDirSuffix);DataDirSuffix=$(DataDirSuffix);ApplicationName=$(ApplicationName);SafeApplicationName=$(SafeApplicationName);Manufacturer=$(Manufacturer);SafeManufacturer=$(SafeManufacturer);BundleId=$(BundleId);UpgradeCode=$(UpgradeCode);VersionNumber=$(VersionNumber);TruncatedVersion=$(TruncatedVersion);Year=$(Year);MajorVersion=$(MajorVersion)"
5461
/>
5562
</Target>
5663

FLExInstaller/FieldWorks.Bundle.wixproj

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,35 @@
1-
<Project Sdk="WixToolset.Sdk/6.0.0">
1+
<Project Sdk="WixToolset.Sdk/6.0.2">
22
<PropertyGroup>
33
<OutputName>FieldWorksBundle</OutputName>
44
<OutputType>Bundle</OutputType>
55
<TargetFramework>net48</TargetFramework>
66
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
7+
8+
<!-- Prefer explicit package paths when resolving WixExtension items; otherwise MSBuild's ReferencePaths can
9+
accidentally bind to older extension DLLs if multiple versions exist under ./packages. -->
10+
<WixExtensionSearchPaths>{RawFileName};{HintPathFromItem};$(ReferencePaths)</WixExtensionSearchPaths>
711
</PropertyGroup>
812

913
<PropertyGroup>
1014
<!-- Defaults for local dev, overridden by Installer.targets -->
1115
<ApplicationName Condition="'$(ApplicationName)' == ''">FieldWorks</ApplicationName>
1216
<SafeApplicationName Condition="'$(SafeApplicationName)' == ''">FieldWorks</SafeApplicationName>
1317
<Manufacturer Condition="'$(Manufacturer)' == ''">SIL International</Manufacturer>
18+
<SafeManufacturer Condition="'$(SafeManufacturer)' == ''">SIL</SafeManufacturer>
19+
<BundleId Condition="'$(BundleId)' == ''">$(SafeManufacturer).$(SafeApplicationName)</BundleId>
1420
<UpgradeCode Condition="'$(UpgradeCode)' == ''">1092269F-9EA1-419B-8685-90203F83E254</UpgradeCode>
1521
<Year Condition="'$(Year)' == ''">$([System.DateTime]::Now.Year)</Year>
1622
<MajorVersion Condition="'$(MajorVersion)' == ''">9</MajorVersion>
1723
<TruncatedVersion Condition="'$(TruncatedVersion)' == ''">$(MajorVersion).0</TruncatedVersion>
1824
<VersionNumber Condition="'$(VersionNumber)' == ''">$(TruncatedVersion).0.1</VersionNumber>
1925

20-
<DefineConstants>ApplicationName=$(ApplicationName);SafeApplicationName=$(SafeApplicationName);TruncatedVersion=$(TruncatedVersion);VersionNumber=$(VersionNumber);UpgradeCode=$(UpgradeCode);Year=$(Year);Manufacturer=$(Manufacturer);$(DefineConstants)</DefineConstants>
26+
<DefineConstants>ApplicationName=$(ApplicationName);SafeApplicationName=$(SafeApplicationName);TruncatedVersion=$(TruncatedVersion);VersionNumber=$(VersionNumber);BundleId=$(BundleId);UpgradeCode=$(UpgradeCode);Year=$(Year);Manufacturer=$(Manufacturer);SafeManufacturer=$(SafeManufacturer);$(DefineConstants)</DefineConstants>
2127
</PropertyGroup>
2228

2329
<ItemGroup>
24-
<PackageReference Include="WixToolset.Bal.wixext" Version="6.0.0" />
25-
<PackageReference Include="WixToolset.Util.wixext" Version="6.0.0" />
26-
<PackageReference Include="WixToolset.NetFx.wixext" Version="6.0.0" />
30+
<PackageReference Include="WixToolset.Bal.wixext" Version="6.0.2" />
31+
<PackageReference Include="WixToolset.Util.wixext" Version="6.0.2" />
32+
<PackageReference Include="WixToolset.NetFx.wixext" Version="6.0.2" />
2733
</ItemGroup>
2834

2935
<ItemGroup>
@@ -38,6 +44,16 @@
3844

3945
<MakeDir Directories="$(_BundleSourceDir)" />
4046

47+
<!--
48+
WixStdBA theme resources are bound by file name. Stage flat-named copies into the culture output folder
49+
so ThemeFile/LocalizationFile/LogoFile can be simple names and the theme can resolve ImageFile paths.
50+
-->
51+
<Copy SourceFiles="Shared\Base\BundleTheme.xml" DestinationFiles="$(_BundleCultureDir)\BundleTheme.xml" />
52+
<Copy SourceFiles="Shared\Base\BundleTheme.wxl" DestinationFiles="$(_BundleCultureDir)\BundleTheme.wxl" />
53+
<Copy SourceFiles="Shared\resources\logo.png" DestinationFiles="$(_BundleCultureDir)\fw-logo.png" />
54+
<Copy SourceFiles="Shared\resources\bundle_background.bmp" DestinationFiles="$(_BundleCultureDir)\bundle_background.bmp" />
55+
<Copy SourceFiles="Shared\resources\License.htm" DestinationFiles="$(_BundleCultureDir)\License.htm" />
56+
4157
<Exec Command="powershell.exe -NoProfile -ExecutionPolicy Bypass -Command &quot;if (!(Test-Path -LiteralPath '$(_BundleSourceDir)\\vcredist_vc8_$(Platform).exe')) { Invoke-WebRequest -Uri 'https://download.microsoft.com/download/5/D/8/5D8C65CB-C849-4025-8E95-C3966CAFD8AE/vcredist_$(Platform).exe' -OutFile '$(_BundleSourceDir)\\vcredist_vc8_$(Platform).exe' }&quot;" />
4258
<Exec Command="powershell.exe -NoProfile -ExecutionPolicy Bypass -Command &quot;if (!(Test-Path -LiteralPath '$(_BundleSourceDir)\\vcredist_vc10_$(Platform).exe')) { Invoke-WebRequest -Uri 'https://download.microsoft.com/download/1/6/5/165255E7-1014-4D0A-B094-B6A430A6BFFC/vcredist_$(Platform).exe' -OutFile '$(_BundleSourceDir)\\vcredist_vc10_$(Platform).exe' }&quot;" />
4359
<Exec Command="powershell.exe -NoProfile -ExecutionPolicy Bypass -Command &quot;if (!(Test-Path -LiteralPath '$(_BundleSourceDir)\\vcredist_vc11_$(Platform).exe')) { Invoke-WebRequest -Uri 'https://download.microsoft.com/download/1/6/B/16B06F60-3B20-4FF2-B699-5E9B7962F9AE/VSU_4/vcredist_$(Platform).exe' -OutFile '$(_BundleSourceDir)\\vcredist_vc11_$(Platform).exe' }&quot;" />

FLExInstaller/FieldWorks.Installer.wixproj

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
1-
<Project Sdk="WixToolset.Sdk/6.0.0">
1+
<Project Sdk="WixToolset.Sdk/6.0.2">
22
<PropertyGroup>
33
<OutputName>FieldWorks</OutputName>
44
<OutputType>Package</OutputType>
55
<TargetFramework>net48</TargetFramework>
66
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
77

8+
<!-- Prefer explicit package paths when resolving WixExtension items; otherwise MSBuild's ReferencePaths can
9+
accidentally bind to older extension DLLs if multiple versions exist under ./packages. -->
10+
<WixExtensionSearchPaths>{RawFileName};{HintPathFromItem};$(ReferencePaths)</WixExtensionSearchPaths>
11+
812
<!--
913
Installer validation:
1014
- Harvested inputs include many versionless resource/data files that trigger ICE60.
@@ -49,10 +53,10 @@
4953
</PropertyGroup>
5054

5155
<ItemGroup>
52-
<PackageReference Include="WixToolset.UI.wixext" Version="6.0.0" />
53-
<PackageReference Include="WixToolset.Util.wixext" Version="6.0.0" />
54-
<PackageReference Include="WixToolset.NetFx.wixext" Version="6.0.0" />
55-
<PackageReference Include="WixToolset.Heat" Version="6.0.0" />
56+
<PackageReference Include="WixToolset.UI.wixext" Version="6.0.2" />
57+
<PackageReference Include="WixToolset.Util.wixext" Version="6.0.2" />
58+
<PackageReference Include="WixToolset.NetFx.wixext" Version="6.0.2" />
59+
<PackageReference Include="WixToolset.Heat" Version="6.0.2" />
5660
</ItemGroup>
5761

5862
<ItemGroup>
@@ -77,8 +81,8 @@
7781
WiX v6 SDK dependencies are restored into the repo-local ./packages folder in this repo.
7882
Use that first so we don't depend on the global NuGet cache layout.
7983
-->
80-
<_HeatExeFromRepo>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), ..\packages\wixtoolset.heat\6.0.0\tools\net472\x64\heat.exe))</_HeatExeFromRepo>
81-
<_HeatExeFromNuGetRoot>$([MSBuild]::NormalizePath($(NuGetPackageRoot), wixtoolset.heat\6.0.0\tools\net472\x64\heat.exe))</_HeatExeFromNuGetRoot>
84+
<_HeatExeFromRepo>$([MSBuild]::NormalizePath($(MSBuildProjectDirectory), ..\packages\wixtoolset.heat\6.0.2\tools\net472\x64\heat.exe))</_HeatExeFromRepo>
85+
<_HeatExeFromNuGetRoot>$([MSBuild]::NormalizePath($(NuGetPackageRoot), wixtoolset.heat\6.0.2\tools\net472\x64\heat.exe))</_HeatExeFromNuGetRoot>
8286
<_HeatExe Condition="Exists('$(_HeatExeFromRepo)')">$(_HeatExeFromRepo)</_HeatExe>
8387
<_HeatExe Condition="'$(_HeatExe)' == '' and Exists('$(_HeatExeFromNuGetRoot)')">$(_HeatExeFromNuGetRoot)</_HeatExe>
8488
</PropertyGroup>
@@ -87,7 +91,7 @@
8791

8892
<Error
8993
Condition="!Exists('$(_HeatExe)')"
90-
Text="Heat tool not found. Expected either '$(_HeatExeFromRepo)' or '$(_HeatExeFromNuGetRoot)'. Ensure restore succeeded (WixToolset.Heat 6.0.0)." />
94+
Text="Heat tool not found. Expected either '$(_HeatExeFromRepo)' or '$(_HeatExeFromNuGetRoot)'. Ensure restore succeeded (WixToolset.Heat 6.0.2)." />
9195

9296
<!-- Harvest using WiX Toolset Heat from the WiX v6 toolchain (WixToolset.Heat package). -->
9397
<Exec
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<Project Sdk="WixToolset.Sdk/6.0.2">
2+
<PropertyGroup>
3+
<OutputName>FieldWorksOfflineBundle</OutputName>
4+
<OutputType>Bundle</OutputType>
5+
<TargetFramework>net48</TargetFramework>
6+
<EnableDefaultCompileItems>false</EnableDefaultCompileItems>
7+
8+
<!-- Prefer explicit package paths when resolving WixExtension items; otherwise MSBuild's ReferencePaths can
9+
accidentally bind to older extension DLLs if multiple versions exist under ./packages. -->
10+
<WixExtensionSearchPaths>{RawFileName};{HintPathFromItem};$(ReferencePaths)</WixExtensionSearchPaths>
11+
</PropertyGroup>
12+
13+
<PropertyGroup>
14+
<!-- Defaults for local dev, overridden by Installer.targets -->
15+
<ApplicationName Condition="'$(ApplicationName)' == ''">FieldWorks</ApplicationName>
16+
<SafeApplicationName Condition="'$(SafeApplicationName)' == ''">FieldWorks</SafeApplicationName>
17+
<Manufacturer Condition="'$(Manufacturer)' == ''">SIL International</Manufacturer>
18+
<SafeManufacturer Condition="'$(SafeManufacturer)' == ''">SIL</SafeManufacturer>
19+
<BundleId Condition="'$(BundleId)' == ''">$(SafeManufacturer).$(SafeApplicationName)</BundleId>
20+
<UpgradeCode Condition="'$(UpgradeCode)' == ''">1092269F-9EA1-419B-8685-90203F83E254</UpgradeCode>
21+
<Year Condition="'$(Year)' == ''">$([System.DateTime]::Now.Year)</Year>
22+
<MajorVersion Condition="'$(MajorVersion)' == ''">9</MajorVersion>
23+
<TruncatedVersion Condition="'$(TruncatedVersion)' == ''">$(MajorVersion).0</TruncatedVersion>
24+
<VersionNumber Condition="'$(VersionNumber)' == ''">$(TruncatedVersion).0.1</VersionNumber>
25+
26+
<DefineConstants>ApplicationName=$(ApplicationName);SafeApplicationName=$(SafeApplicationName);TruncatedVersion=$(TruncatedVersion);VersionNumber=$(VersionNumber);BundleId=$(BundleId);UpgradeCode=$(UpgradeCode);Year=$(Year);Manufacturer=$(Manufacturer);SafeManufacturer=$(SafeManufacturer);$(DefineConstants)</DefineConstants>
27+
</PropertyGroup>
28+
29+
<ItemGroup>
30+
<PackageReference Include="WixToolset.Bal.wixext" Version="6.0.2" />
31+
<PackageReference Include="WixToolset.Util.wixext" Version="6.0.2" />
32+
</ItemGroup>
33+
34+
<ItemGroup>
35+
<Compile Include="Shared\Base\OfflineBundle.wxs" />
36+
</ItemGroup>
37+
38+
<Target Name="StageOfflineBundlePayloads" BeforeTargets="CoreCompile">
39+
<PropertyGroup>
40+
<_BundleCultureDir>$(MSBuildProjectDirectory)\bin\$(Platform)\$(Configuration)\en-US</_BundleCultureDir>
41+
<_BundleSourceDir>$(_BundleCultureDir)\SourceDir</_BundleSourceDir>
42+
<_LibsDir>$(MSBuildProjectDirectory)\libs</_LibsDir>
43+
</PropertyGroup>
44+
45+
<MakeDir Directories="$(_BundleSourceDir)" />
46+
47+
<Copy SourceFiles="Shared\Base\BundleTheme.xml" DestinationFiles="$(_BundleCultureDir)\BundleTheme.xml" />
48+
<Copy SourceFiles="Shared\Base\BundleTheme.wxl" DestinationFiles="$(_BundleCultureDir)\BundleTheme.wxl" />
49+
<Copy SourceFiles="Shared\resources\logo.png" DestinationFiles="$(_BundleCultureDir)\fw-logo.png" />
50+
<Copy SourceFiles="Shared\resources\bundle_background.bmp" DestinationFiles="$(_BundleCultureDir)\bundle_background.bmp" />
51+
<Copy SourceFiles="Shared\resources\License.htm" DestinationFiles="$(_BundleCultureDir)\License.htm" />
52+
53+
<!-- Offline prerequisites are sourced from the repo-local FLExInstaller\libs folder and embedded into the bundle. -->
54+
<Copy SourceFiles="$(_LibsDir)\ndp48-x86-x64-allos-enu.exe" DestinationFiles="$(_BundleSourceDir)\ndp48-x86-x64-allos-enu.exe" />
55+
<Copy SourceFiles="$(_LibsDir)\vcredist_2008_$(Platform).exe" DestinationFiles="$(_BundleSourceDir)\vcredist_2008_$(Platform).exe" />
56+
<Copy SourceFiles="$(_LibsDir)\vcredist_2010_$(Platform).exe" DestinationFiles="$(_BundleSourceDir)\vcredist_2010_$(Platform).exe" />
57+
<Copy SourceFiles="$(_LibsDir)\vcredist_2012_$(Platform).exe" DestinationFiles="$(_BundleSourceDir)\vcredist_2012_$(Platform).exe" />
58+
<Copy SourceFiles="$(_LibsDir)\vcredist_2013_$(Platform).exe" DestinationFiles="$(_BundleSourceDir)\vcredist_2013_$(Platform).exe" />
59+
<Copy SourceFiles="$(_LibsDir)\vcredist_2015-19_$(Platform).exe" DestinationFiles="$(_BundleSourceDir)\vcredist_2015-19_$(Platform).exe" />
60+
</Target>
61+
62+
<Target Name="EnsureBundleNotRunning" BeforeTargets="CopyFilesToOutputDirectory">
63+
<PropertyGroup>
64+
<_BundleExeName>$(OutputName)</_BundleExeName>
65+
</PropertyGroup>
66+
67+
<Message Text="Checking for running $(_BundleExeName).exe processes that may lock $(TargetPath)" Importance="high" />
68+
<Exec Command="powershell.exe -NoProfile -ExecutionPolicy Bypass -Command &quot;$targetPath = '$(TargetPath)'; $isLocked = $false; if (Test-Path -LiteralPath $targetPath) { try { $fs = [System.IO.File]::Open($targetPath, [System.IO.FileMode]::Open, [System.IO.FileAccess]::ReadWrite, [System.IO.FileShare]::None); $fs.Close(); } catch { $isLocked = $true; Write-Output ('Bundle output is locked: {0}' -f $targetPath); } }; $procs = @(Get-Process -Name '$(_BundleExeName)' -ErrorAction SilentlyContinue); if ($procs.Count -eq 0) { Write-Output 'No running bundle processes found.' } else { foreach ($p in $procs) { Write-Output ('Found process Id={0} Name={1} Title={2}' -f $p.Id,$p.ProcessName,$p.MainWindowTitle) } }; if ($isLocked) { Write-Output 'Close the running bundle (or run elevated) and retry.'; exit 1 } else { exit 0 }&quot;" />
69+
</Target>
70+
71+
<ItemGroup>
72+
<ProjectReference Include="FieldWorks.Installer.wixproj" />
73+
</ItemGroup>
74+
75+
<Target Name="SignBundle" AfterTargets="Build" Condition="'$(SignOutput)'=='true'">
76+
<Exec Command="call Shared\Base\signingProxy.bat &quot;$(OutputPath)$(OutputName).exe&quot;" />
77+
</Target>
78+
</Project>

FLExInstaller/Overrides.wxi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<Include>
2+
<Include xmlns="http://wixtoolset.org/schemas/v4/wxs">
33
<!-- Set the projects dir to what the user had chosen before.
44
(WiX Note: later registry searches replace results of earlier searches, so the current version's directory is preferred over the previous version's.)
55
Look for FieldWorks\8 in the 32-bit registry space since FieldWorks 8 was only 32-bit. -->
66
<Property Id="REGDATAFOLDER">
7-
<RegistrySearch Id="LegacyDataFolder" Root="HKLM" Key="SOFTWARE\SIL\FieldWorks\8" Name="[DATAFOLDERREGSZNAME]" Type="directory" Win64="no"/>
7+
<RegistrySearch Id="LegacyDataFolder" Root="HKLM" Key="SOFTWARE\SIL\FieldWorks\8" Name="[DATAFOLDERREGSZNAME]" Type="directory" Bitness="always32"/>
88
<RegistrySearch Id="RegistryDataFolder" Root="HKLM" Key="SOFTWARE\[REGISTRYKEY]" Name="[DATAFOLDERREGSZNAME]" Type="directory"/>
99
</Property>
1010
<Property Id="REGISTRYKEY" Value="SIL\$(var.SafeApplicationName)\$(var.MajorVersion)"/>
@@ -13,6 +13,6 @@
1313
<SetProperty Id="OVRAPPFOLDER" Value="[$(var.PFDir)]\SIL\$(var.SafeApplicationName) $(var.MajorVersion)\" Before="AppSearch"/>
1414
<SetProperty Id="OVRHARVESTDATAFOLDER" Value="[CommonAppDataFolder]SIL" Before="AppSearch"/>
1515
<SetProperty Id="OVRDATAFOLDER" Value="[CommonAppDataFolder]SIL\FieldWorks\Projects" Before="AppSearch"/>
16-
<SetProperty Id="QtExecCmdLine" Value="&quot;cmd&quot; /c (set ICU_DATA=[OVRHARVESTDATAFOLDER]\Icu70) &amp; &quot;[APPFOLDER]\UnicodeCharEditor.exe&quot; -i" Before="InstallFinalize" Sequence="execute"/>
17-
<CustomAction Id="LaunchUnicodeCharEditor" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="immediate" Return="check"/>
16+
<SetProperty Id="LaunchUnicodeCharEditor" Value="&quot;cmd&quot; /c (set ICU_DATA=[OVRHARVESTDATAFOLDER]\Icu70) &amp; &quot;[APPFOLDER]\UnicodeCharEditor.exe&quot; -i" Before="InstallFinalize" Sequence="execute"/>
17+
<CustomAction Id="LaunchUnicodeCharEditor" BinaryRef="Wix4UtilCA_X64" DllEntry="WixQuietExec" Execute="immediate" Return="check"/>
1818
</Include>

0 commit comments

Comments
 (0)