forked from windirstat/windirstat
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWinDirStat.wxs
119 lines (119 loc) · 8.25 KB
/
WinDirStat.wxs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?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="500" Compressed="yes" InstallScope="perMachine"/>
<Icon Id="WinDirStat.ico" SourceFile="$(var.IconFilePath)"/>
<Property Id="ARPPRODUCTICON" Value="WinDirStat.ico"/>
<MajorUpgrade AllowSameVersionUpgrades="$(var.AllowSameVersionUpgrades)" DowngradeErrorMessage="A newer version of [ProductName] is already installed." Schedule="afterInstallInitialize"/>
<MediaTemplate EmbedCab="yes" CompressionLevel="high"/>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER"/>
<UIRef Id="WixUI_InstallDir"/>
<WixVariable Id="WixUILicenseRtf" Value="$(var.LicenseRtf)"/>
<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"/>
<ComponentRef Id="Component_ContextMenuEntry"/>
<ComponentRef Id="Component_DesktopShortcut"/>
</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>
<Property Id="WAIT_PROCESS" Value="POWERSHELL.EXE -WindowStyle Hidden -Command "While (@(Get-Process 'Au_' -Ea SilentlyContinue)) { Start-Sleep 1 }""/>
<CustomAction Id="DoUninstallHKCU" Directory="TempFolder" ExeCommand="CMD.EXE /C [WIN_DIR_STAT_HKCU] /S" Execute="immediate" Impersonate="yes" Return="ignore"/>
<CustomAction Id="WaitForProcessHKCU" Directory="TempFolder" ExeCommand="[WAIT_PROCESS]" Execute="immediate" Impersonate="yes" Return="ignore"/>
<CustomAction Id="DoUninstallHKLM" Directory="TempFolder" ExeCommand="CMD.EXE /C [WIN_DIR_STAT_HKLM] /S" Execute="immediate" Impersonate="no" Return="ignore"/>
<CustomAction Id="WaitForProcessHKLM" Directory="TempFolder" ExeCommand="[WAIT_PROCESS]" Execute="immediate" Impersonate="no" Return="ignore"/>
<InstallExecuteSequence>
<Custom Action="DoUninstallHKCU" Before="InstallInitialize">WIN_DIR_STAT_HKCU AND NOT REMOVE</Custom>
<Custom Action="WaitForProcessHKCU" After="DoUninstallHKCU">WIN_DIR_STAT_HKCU AND NOT REMOVE</Custom>
<Custom Action="DoUninstallHKLM" Before="InstallInitialize">WIN_DIR_STAT_HKLM AND NOT REMOVE</Custom>
<Custom Action="WaitForProcessHKLM" After="DoUninstallHKLM">WIN_DIR_STAT_HKLM AND NOT REMOVE</Custom>
</InstallExecuteSequence>
<Property Id="DESKTOP_SHORTCUT_LOCATE">
<DirectorySearch Id="DesktopFolderSearch" Path="[DesktopFolder]" AssignToProperty="yes">
<FileSearch Id="DesktopShortcutFileSearch" Name="WinDirStat.lnk"/>
</DirectorySearch>
</Property>
<SetProperty Id="DESKTOP_SHORTCUT" After="AppSearch" Value="1" Sequence="first">
<![CDATA[((WIX_UPGRADE_DETECTED <> "" AND DESKTOP_SHORTCUT_LOCATE <> "") OR ENABLE_SHORTCUT = 1)]]></SetProperty>
<Property Id="CONTEXT_MENU_LOCATE">
<RegistrySearch Id='ContextMenuSearch' Type='raw' Root='HKCR' Key='Directory\shell\WinDirStat' Name="Icon" Win64="$(var.Win64)"/>
</Property>
<SetProperty Id="CONTEXTMENU_ENTRY" After="AppSearch" Value="1" Sequence="first">
<![CDATA[((WIX_UPGRADE_DETECTED <> "" AND CONTEXT_MENU_LOCATE <> "") OR NOT WIX_UPGRADE_DETECTED) AND DISABLE_CONTEXTMENU <> 1]]></SetProperty>
<UI Id="InstallerUI">
<Dialog Id="OptionsDlg" Width="370" Height="270" Title="WinDirStat Options">
<Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="2"/>
<Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="2"/>
<Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes">
<Text>Select the options below to customize your WinDirStat experience.</Text>
</Control>
<Control Id="Title" Type="Text" X="15" Y="6" Width="210" Height="15" Transparent="yes" NoPrefix="yes" Text="{\WixUI_Font_Title}Install Options"/>
<Control Id="DesktopShortcutCheckBox" Type="CheckBox" Height="18" Width="295" X="26" Y="58" Text="Create Desktop Shortcut" Property="DESKTOP_SHORTCUT" CheckBoxValue="1"/>
<Control Id="ContextMenuEntryCheckBox" Type="CheckBox" Height="18" Width="295" X="26" Y="79" Text="Create Classic Shell Context Menu Entry" Property="CONTEXTMENU_ENTRY" CheckBoxValue="1"/>
<Control Id="Next" Type="PushButton" X="248" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
<Publish Event="NewDialog" Value="VerifyReadyDlg" Order="10"/>
</Control>
<Control Id="Back" Type="PushButton" X="192" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)">
<Publish Event="NewDialog" Value="InstallDirDlg" Order="10"/>
</Control>
<Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
<Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
</Control>
</Dialog>
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="OptionsDlg" Order="10">NOT Installed</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="OptionsDlg" Order="10">NOT Installed</Publish>
</UI>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="$(var.ProgramFilesNative)">
<Directory Id="INSTALLFOLDER" Name="WinDirStat"/>
</Directory>
<Directory Id="ProgramMenuFolder"/>
<Directory Id="TempFolder"/>
<Directory Id="DesktopFolder" Name="Desktop"/>
</Directory>
</Fragment>
<Fragment>
<DirectoryRef Id="INSTALLFOLDER">
<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"/>
</Shortcut>
</File>
</Component>
</DirectoryRef>
</Fragment>
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Component Id="Component_ContextMenuEntry" Guid="{7B6A2A2E-BF9E-4F37-8EAA-0E7E6B98D87A}" Win64="$(var.Win64)">
<Condition>CONTEXTMENU_ENTRY</Condition>
<RegistryKey Root="HKCR" Key="Directory\shell\WinDirStat" ForceDeleteOnUninstall="yes">
<RegistryValue Name="Icon" Value="[INSTALLFOLDER]WinDirStat.exe" Type="string"/>
<RegistryValue Value="WinDirStat" Type="string"/>
<RegistryKey Key="command">
<RegistryValue Value=""[INSTALLFOLDER]WinDirStat.exe" "0|%1"" Type="string"/>
</RegistryKey>
</RegistryKey>
<RegistryKey Root="HKCR" Key="Drive\shell\WinDirStat" ForceDeleteOnUninstall="yes">
<RegistryValue Name="Icon" Value="[INSTALLFOLDER]WinDirStat.exe" Type="string"/>
<RegistryValue Value="WinDirStat" Type="string"/>
<RegistryKey Key="command">
<RegistryValue Value=""[INSTALLFOLDER]WinDirStat.exe" "0|%1"" Type="string"/>
</RegistryKey>
</RegistryKey>
</Component>
<Component Id="Component_DesktopShortcut" Guid="{82879C46-B937-405B-8931-EB8FE3CF606A}" Win64="$(var.Win64)">
<Condition>DESKTOP_SHORTCUT</Condition>
<Shortcut Id="ConfigDesktopShortcut" Name="WinDirStat" WorkingDirectory="INSTALLFOLDER" Directory="DesktopFolder" Target="[INSTALLFOLDER]WinDirStat.exe"/>
</Component>
</DirectoryRef>
</Fragment>
</Wix>