Skip to content

Commit

Permalink
Format main.wxs and use ASCII codepage
Browse files Browse the repository at this point in the history
  • Loading branch information
printfn committed Mar 11, 2024
1 parent f4ee314 commit 86d7a99
Showing 1 changed file with 72 additions and 49 deletions.
121 changes: 72 additions & 49 deletions windows-wix/main.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,45 @@

<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" xmlns:ui="http://wixtoolset.org/schemas/v4/wxs/ui">

<Package Name="fend" UpgradeCode="2E3C8164-E07C-4B26-82B2-C5613FE8AD8F" Manufacturer="printfn" Language="1033" Codepage="1252" Version="$(var.Version)" InstallerVersion="450"><SummaryInformation Keywords="Installer" Description="Arbitrary-precision unit-aware calculator" Manufacturer="printfn" />
<Package Name="fend" UpgradeCode="2E3C8164-E07C-4B26-82B2-C5613FE8AD8F" Manufacturer="printfn"
Language="1033" Codepage="0" Version="$(var.Version)" InstallerVersion="450">
<SummaryInformation Keywords="Installer"
Description="Arbitrary-precision unit-aware calculator" Manufacturer="printfn" />

<!--
Same-version upgrades need to be allowed, otherwise fend will get installed multiple
times when installing MSIs with identical version numbers, such as different CI builds.
Unfortunately setting that attribute does result in a compiler warning (LGHT1076).
See https://wixtoolset.org/documentation/manual/v3/xsd/wix/majorupgrade.html for more info.
See https://wixtoolset.org/docs/schema/wxs/majorupgrade/ for more info.
-->
<MajorUpgrade Schedule="afterInstallInitialize" AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed. Setup will now exit." />
<MajorUpgrade Schedule="afterInstallInitialize" AllowSameVersionUpgrades="yes"
DowngradeErrorMessage="A newer version of [ProductName] is already installed. Setup will now exit." />

<Property Id="APPLICATIONFOLDER" Secure="yes">
<RegistrySearch Id="FindInstallLocation" Root="HKCU" Key="Software\fend" Name="InstallationPath" Type="raw" />
<RegistrySearch Id="FindInstallLocation" Root="HKCU" Key="Software\fend"
Name="InstallationPath" Type="raw" />
</Property>

<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" DiskPrompt="CD-ROM #1" />
<Property Id="DiskPrompt" Value="fend Installation" />



<Feature Id="Binaries" Title="Application" Description="Installs fend." Level="1" ConfigurableDirectory="APPLICATIONFOLDER" AllowAdvertise="no" Display="expand" AllowAbsent="no">
<Feature Id="Binaries" Title="Application" Description="Installs fend." Level="1"
ConfigurableDirectory="APPLICATIONFOLDER" AllowAdvertise="no" Display="expand"
AllowAbsent="no">

<ComponentRef Id="License" />
<ComponentRef Id="binary0" />
<ComponentRef Id="ApplicationShortcut" />

<Feature Id="Environment" Title="PATH Environment Variable" Description="Add the install location of the [ProductName] executable to the PATH system environment variable. This allows the [ProductName] executable to be called from any location." Level="1">
<Feature Id="Environment" Title="PATH Environment Variable"
Description="Add the install location of the [ProductName] executable to the PATH system environment variable. This allows the [ProductName] executable to be called from any location."
Level="1">
<ComponentRef Id="Path" />
</Feature>


<Feature Id="DesktopShortcut" Title="Add a Desktop shortcut" Description="Creates a shortcut on your desktop for easier access." Level="1">
<Feature Id="DesktopShortcut" Title="Add a Desktop shortcut"
Description="Creates a shortcut on your desktop for easier access." Level="1">
<ComponentRef Id="ApplicationShortcutDesktop" />
</Feature>
</Feature>
Expand All @@ -71,51 +79,66 @@

<UI>
<ui:WixUI Id="WixUI_FeatureTree" />
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg" Order="99" />
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="99" />
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication" Condition="WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed" />
<Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg"
Order="99" />
<Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg"
Order="99" />
<Publish Dialog="ExitDialog" Control="Finish" Event="DoAction" Value="LaunchApplication"
Condition="WIXUI_EXITDIALOGOPTIONALCHECKBOX = 1 and NOT Installed" />
</UI>

<Property Id="WixShellExecTarget" Value="[#fend.exe]" />
<CustomAction Id="LaunchApplication" DllEntry="WixShellExec" Impersonate="yes" BinaryRef="Wix4UtilCA_X86" />

<StandardDirectory Id="ProgramMenuFolder">
<!-- Create shortcut to start fend from the taskbar -->
<Directory Id="ApplicationProgramsFolder" Name="fend">
<Component Id="ApplicationShortcut" Guid="{15F35903-1FBC-47C0-852D-BFC51D428385}">
<Shortcut Id="ApplicationStartMenuShortcut" Name="fend" Description="Arbitrary-precision unit-aware calculator" Target="[!fend.exe]" WorkingDirectory="APPLICATIONFOLDER" />
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\fend" Name="installed" Type="integer" Value="1" KeyPath="yes" />
<!-- make upgrading easier by remembering where it was installed -->
<RegistryValue Root="HKCU" Key="Software\fend" Name="InstallationPath" Type="string" Value="[APPLICATIONFOLDER]" />
<CustomAction Id="LaunchApplication" DllEntry="WixShellExec" Impersonate="yes"
BinaryRef="Wix4UtilCA_X86" />

<StandardDirectory Id="ProgramMenuFolder">
<!-- Create shortcut to start fend from the taskbar -->
<Directory Id="ApplicationProgramsFolder" Name="fend">
<Component Id="ApplicationShortcut" Guid="{15F35903-1FBC-47C0-852D-BFC51D428385}">
<Shortcut Id="ApplicationStartMenuShortcut" Name="fend"
Description="Arbitrary-precision unit-aware calculator" Target="[!fend.exe]"
WorkingDirectory="APPLICATIONFOLDER" />
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder"
On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\fend" Name="installed" Type="integer"
Value="1" KeyPath="yes" />
<!-- make upgrading easier by remembering where it was installed -->
<RegistryValue Root="HKCU" Key="Software\fend" Name="InstallationPath"
Type="string" Value="[APPLICATIONFOLDER]" />
</Component>
</Directory>
</StandardDirectory>

<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="APPLICATIONFOLDER" Name="fend">
<Component Id="License">
<File Id="LicenseFile" Name="LICENSE.md" DiskId="1"
Source="$(var.LicenseMdPath)" KeyPath="yes" />
</Component>
<Directory Id="Bin" Name="bin">
<Component Id="Path" Guid="CDEF645B-899B-4FB5-B932-70DDF60C1D24" KeyPath="yes">
<Environment Id="PATH" Name="PATH" Value="[Bin]" Permanent="no" Part="last"
Action="set" System="yes" />
</Component>
</Directory>
</StandardDirectory>

<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="APPLICATIONFOLDER" Name="fend">
<Component Id="License">
<File Id="LicenseFile" Name="LICENSE.md" DiskId="1" Source="$(var.LicenseMdPath)" KeyPath="yes" />
<Component Id="binary0">
<File Id="fend.exe" Name="fend.exe" DiskId="1" Source="$(var.FendExePath)"
KeyPath="yes" />
</Component>
<Directory Id="Bin" Name="bin">
<Component Id="Path" Guid="CDEF645B-899B-4FB5-B932-70DDF60C1D24" KeyPath="yes">
<Environment Id="PATH" Name="PATH" Value="[Bin]" Permanent="no" Part="last" Action="set" System="yes" />
</Component>
<Component Id="binary0">
<File Id="fend.exe" Name="fend.exe" DiskId="1" Source="$(var.FendExePath)" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</StandardDirectory>

<StandardDirectory Id="DesktopFolder">
<!-- Create shortcut to start fend from the desktop -->
<Component Id="ApplicationShortcutDesktop" Guid="6EC22391-82AE-4394-BD05-6930293265EA">
<Shortcut Id="ApplicationDesktopShortcut" Name="fend" Description="Arbitrary-precision unit-aware calculator" Target="[!fend.exe]" WorkingDirectory="APPLICATIONFOLDER" />
<RemoveFolder Id="CleanUpDesktopShortcut" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\fend" Name="DesktopShortcut" Type="integer" Value="1" KeyPath="yes" />
</Component>
</StandardDirectory>
</Package>
</Directory>
</StandardDirectory>

<StandardDirectory Id="DesktopFolder">
<!-- Create shortcut to start fend from the desktop -->
<Component Id="ApplicationShortcutDesktop" Guid="6EC22391-82AE-4394-BD05-6930293265EA">
<Shortcut Id="ApplicationDesktopShortcut" Name="fend"
Description="Arbitrary-precision unit-aware calculator" Target="[!fend.exe]"
WorkingDirectory="APPLICATIONFOLDER" />
<RemoveFolder Id="CleanUpDesktopShortcut" On="uninstall" />
<RegistryValue Root="HKCU" Key="Software\fend" Name="DesktopShortcut" Type="integer"
Value="1" KeyPath="yes" />
</Component>
</StandardDirectory>
</Package>

</Wix>

0 comments on commit 86d7a99

Please sign in to comment.