Skip to content

Commit

Permalink
Uninstall Old Installer / Installer UI Enhancements
Browse files Browse the repository at this point in the history
  • Loading branch information
NoMoreFood committed Jul 13, 2024
1 parent 00a6ae7 commit 9ed6777
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 23 deletions.
Binary file added setup/Background.bmp
Binary file not shown.
Binary file added setup/Banner.bmp
Binary file not shown.
32 changes: 16 additions & 16 deletions setup/Defines.wxi
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Include>
<!-- Product GUIDs & Version Number -->
<Include>
<!-- Product GUIDs & Version Number -->
<?define ProductVersion = "2.0.0"?>
<?define UpgradeCode = "E211CCFB-D706-4919-B2FF-0F7F426EA27B"?>
<?define ProductID = "EB9B4D4D-D88C-424A-87AA-B7EF40BCB072"?>
<!-- Product and Company information -->
<?define ProductID = "*"?>
<!-- Product and Company information -->
<?define ProductName = "WinDirStat"?>
<?define ProductFolder = "WinDirStat"?>
<?define Manufacturer = "WinDirStat Team"?>
Expand All @@ -14,18 +14,18 @@

<?define ProductBinariesDir = "..\build"?>
<?define LicenseRtf = "license.rtf"?>

<?if $(sys.BUILDARCH) = x64 ?>
<?define Win64 = "yes" ?>
<?define WinDirStatExe = "WinDirStat64.exe" ?>
<?define ProgramFilesNative = "ProgramFiles64Folder" ?>
<?else ?>
<?define Win64 = "no" ?>
<?define WinDirStatExe = "WinDirStat32.exe" ?>
<?define ProgramFilesNative = "ProgramFilesFolder" ?>
<?endif ?>

<?define BannerBmp = "banner.bmp"?>
<?define DialogBmp = "background.bmp"?>

<?if $(sys.BUILDARCH) = x64 ?>
<?define Win64 = "yes" ?>
<?define WinDirStatExe = "WinDirStat64.exe" ?>
<?define ProgramFilesNative = "ProgramFiles64Folder" ?>
<?else ?>
<?define Win64 = "no" ?>
<?define WinDirStatExe = "WinDirStat32.exe" ?>
<?define ProgramFilesNative = "ProgramFilesFolder" ?>
<?endif ?>
<!-- Default Registry Key, in which most registry settings are saved. -->
<?define ProductRegKeyPath = "SOFTWARE\WinDirStat\WinDirStat"?>

</Include>
28 changes: 21 additions & 7 deletions setup/WinDirStat.wxs
Original file line number Diff line number Diff line change
@@ -1,29 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<?include Defines.wxi?>
<Product Id="$(var.ProductID)" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>
<Product Id="$(var.ProductID)" Name="$(var.ProductName)" Language="1033" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine"/>
<Icon Id="WinDirStat.ico" SourceFile="$(var.IconFilePath)"/>
<Property Id="ARPPRODUCTICON" Value="WinDirStat.ico"/>
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize"/>
<MediaTemplate EmbedCab="yes"/>
<MediaTemplate EmbedCab="yes" CompressionLevel="high"/>
<UIRef Id="WixUI_FeatureTree"/>
<WixVariable Id="WixUILicenseRtf" Value="$(var.LicenseRtf)"/>
<Feature Id="FT_Core" Title="Application" Absent="disallow" Description="Includes WinDirStat">
<ComponentRef Id="Comp_Main"/>
<WixVariable Id="WixUIBannerBmp" Value="$(var.BannerBmp)" />
<WixVariable Id="WixUIDialogBmp" Value="$(var.DialogBmp)" />
<Feature Id="FT_Core" Title="WinDirStat" Absent="disallow" Description="Includes WinDirStat">
<ComponentRef Id="Component_Main"/>
</Feature>
<Property Id="WIN_DIR_STAT_HKCU">
<RegistrySearch Id="WinDirStatHKCU" Root="HKCU" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\WinDirStat" Name="UninstallString" Type="raw"/>
</Property>
<Property Id="WIN_DIR_STAT_HKLM">
<RegistrySearch Id="WinDirStatHKLM" Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\Uninstall\WinDirStat" Name="UninstallString" Type="raw" Win64="no"/>
</Property>
<CustomAction Id="DoUninstallHKCU" Property="UninstallHKCU" ExeCommand="[WIN_DIR_STAT_HKCU] /s" Execute="immediate" Impersonate="no" Return="ignore"/>
<CustomAction Id="DoUninstallHKLM" Property="UninstallHKLM" ExeCommand="[WIN_DIR_STAT_HKLM] /s" Execute="immediate" Impersonate="no" Return="ignore"/>
<InstallExecuteSequence>
<Custom Action="DoUninstallHKCU" Before="InstallInitialize">WIN_DIR_STAT_HKCU</Custom>
<Custom Action="DoUninstallHKLM" Before="InstallInitialize">WIN_DIR_STAT_HKLM</Custom>
</InstallExecuteSequence>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.ProgramFilesNative)">
<Directory Id="INSTALLFOLDER" Name="WinDirStat"/>
</Directory>
<Directory Id="ProgramMenuFolder" />
<Directory Id="ProgramMenuFolder"/>
</Directory>
</Fragment>
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<Component Id="Comp_Main" Guid="{48E1104D-2466-4ADC-8BC0-521B6EBA8621}">
<Component Id="Component_Main" Guid="{48E1104D-2466-4ADC-8BC0-521B6EBA8621}" Win64="$(var.Win64)">
<File Id="File_Main" KeyPath="yes" Source="$(var.ProductBinariesDir)\$(var.WinDirStatExe)" Name="WinDirStat.exe">
<Shortcut Id="File_Main_Shortcut" Directory="ProgramMenuFolder" WorkingDirectory="INSTALLFOLDER" Name="WinDirStat" Advertise="no">
<ShortcutProperty Key="{9F4C2855-9F79-4B39-A8D0-E1D42DE1D5F3}, 5" Value="WinDirStat"/>
Expand Down

0 comments on commit 9ed6777

Please sign in to comment.