-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathProduct.wxs
More file actions
154 lines (129 loc) · 8.15 KB
/
Product.wxs
File metadata and controls
154 lines (129 loc) · 8.15 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*"
Language="1033"
Manufacturer="Acme Corporation"
Name="09_InstallerWithUserInterface"
UpgradeCode="{1A4CB73C-DB79-4B4F-9B99-DCCE811B1F0C}"
Version="1.0.0.0">
<Package InstallScope="perMachine" InstallerVersion="200" Compressed="yes" />
<MajorUpgrade DowngradeErrorMessage="A later version of [ProductName] is already installed. Setup will now exit." />
<MediaTemplate EmbedCab="yes" />
<?include InstallationStages.wxi?>
<Property Id="WIXUI_INSTALLDIR" Value="MY_INSTALL_LOCATION" />
<Property Id="POWERSHELLVERSION">
<RegistrySearch Id="POWERSHELLVERSION"
Type="raw"
Root="HKLM"
Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine"
Name="PowerShellVersion" />
</Property>
<Property Id="POWERSHELLEXE">
<RegistrySearch Id="POWERSHELLEXE"
Type="raw"
Root="HKLM"
Key="SOFTWARE\Microsoft\PowerShell\1\ShellIds\Microsoft.PowerShell"
Name="Path" />
</Property>
<Condition Message="You must have PowerShell 3.0 or higher.">
<![CDATA[Installed OR (POWERSHELLEXE AND POWERSHELLVERSION >= "3.0")]]>
</Condition>
<Property Id="MY_PROPERTY" Value="default value" Secure="yes">
<RegistrySearch Id='RegSearch_MY_PROPERTY'
Root='HKLM'
Key='Software\[Manufacturer]\[ProductName]'
Name='My property'
Type='raw' />
</Property>
<CustomAction Id='SaveCmdLineValue_MY_PROPERTY' Property='CMDLINE_MY_PROPERTY' Value='[MY_PROPERTY]' Execute='firstSequence' />
<CustomAction Id='SetFromCmdLineValue_MY_PROPERTY' Property='MY_PROPERTY' Value='[CMDLINE_MY_PROPERTY]' Execute='firstSequence' />
<InstallUISequence>
<Custom Action='SaveCmdLineValue_MY_PROPERTY' Before='AppSearch' />
<Custom Action='SetFromCmdLineValue_MY_PROPERTY' After='AppSearch'>
<![CDATA[CMDLINE_MY_PROPERTY AND (CMDLINE_MY_PROPERTY <> "default value")]]>
</Custom>
</InstallUISequence>
<InstallExecuteSequence>
<Custom Action='SaveCmdLineValue_MY_PROPERTY' Before='AppSearch' />
<Custom Action='SetFromCmdLineValue_MY_PROPERTY' After='AppSearch'>
<![CDATA[CMDLINE_MY_PROPERTY AND (CMDLINE_MY_PROPERTY <> "default value")]]>
</Custom>
</InstallExecuteSequence>
<Property Id="MY_INSTALL_LOCATION" Secure="yes">
<RegistrySearch Id='RegSearch_MY_INSTALL_LOCATION'
Root='HKLM'
Key='Software\[Manufacturer]\[ProductName]'
Name='My install location'
Type='raw' />
</Property>
<CustomAction Id='SaveCmdLineValue_MY_INSTALL_LOCATION' Property='CMDLINE_MY_INSTALL_LOCATION' Value='[MY_INSTALL_LOCATION]' Execute='firstSequence' />
<CustomAction Id='SetFromCmdLineValue_MY_INSTALL_LOCATION' Property='MY_INSTALL_LOCATION' Value='[CMDLINE_MY_INSTALL_LOCATION]' Execute='firstSequence' />
<InstallUISequence>
<Custom Action='SaveCmdLineValue_MY_INSTALL_LOCATION' Before='AppSearch' />
<Custom Action='SetFromCmdLineValue_MY_INSTALL_LOCATION' After='AppSearch'>
CMDLINE_MY_INSTALL_LOCATION
</Custom>
</InstallUISequence>
<InstallExecuteSequence>
<Custom Action='SaveCmdLineValue_MY_INSTALL_LOCATION' Before='AppSearch' />
<Custom Action='SetFromCmdLineValue_MY_INSTALL_LOCATION' After='AppSearch'>
CMDLINE_MY_INSTALL_LOCATION
</Custom>
</InstallExecuteSequence>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="MY_INSTALL_LOCATION" Name="09_InstallerWithUserInterface" />
</Directory>
</Directory>
<ComponentGroup Directory="MY_INSTALL_LOCATION" Id="ProductComponentGroup">
<Component Id="cmp_MyAppendScript_ps1">
<File KeyPath="yes" Source="MyAppendScript.ps1"></File>
</Component>
<Component Id="cmp_RegistryEntry_MY_PROPERTY" Guid="*">
<RegistryKey Root='HKLM' Key='Software\[Manufacturer]\[ProductName]'>
<RegistryValue KeyPath='yes' Type='string' Name='My property' Value='[MY_PROPERTY]' />
</RegistryKey>
</Component>
<Component Id="cmp_RegistryEntry_MY_INSTALL_LOCATION" Guid="*">
<RegistryKey Root='HKLM' Key='Software\[Manufacturer]\[ProductName]'>
<RegistryValue KeyPath='yes' Type='string' Name='My install location' Value='[MY_INSTALL_LOCATION]' />
</RegistryKey>
</Component>
</ComponentGroup>
<SetProperty Id="CA_AppendTextUsingPowerShell_FirstInstall"
Before ="CA_AppendTextUsingPowerShell_FirstInstall"
Sequence="execute"
Value='"[POWERSHELLEXE]" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -File "[MY_INSTALL_LOCATION]MyAppendScript.ps1" -installationStage FirstInstall -propertyValue "[MY_PROPERTY]" -version "[ProductVersion]" -installLocation "[MY_INSTALL_LOCATION] "' />
<SetProperty Id="CA_AppendTextUsingPowerShell_Upgrading"
Before ="CA_AppendTextUsingPowerShell_Upgrading"
Sequence="execute"
Value='"[POWERSHELLEXE]" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -File "[MY_INSTALL_LOCATION]MyAppendScript.ps1" -installationStage Upgrading -propertyValue "[MY_PROPERTY]" -version "[ProductVersion]" -installLocation "[MY_INSTALL_LOCATION] "' />
<SetProperty Id="CA_AppendTextUsingPowerShell_Uninstalling"
Before ="CA_AppendTextUsingPowerShell_Uninstalling"
Sequence="execute"
Value='"[POWERSHELLEXE]" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -File "[MY_INSTALL_LOCATION]MyAppendScript.ps1" -installationStage Uninstalling -propertyValue "[MY_PROPERTY]" -version "[ProductVersion]" -installLocation "[MY_INSTALL_LOCATION] "' />
<SetProperty Id="CA_AppendTextUsingPowerShell_Maintenance"
Before ="CA_AppendTextUsingPowerShell_Maintenance"
Sequence="execute"
Value='"[POWERSHELLEXE]" -NoLogo -NonInteractive -NoProfile -ExecutionPolicy Bypass -File "[MY_INSTALL_LOCATION]MyAppendScript.ps1" -installationStage Maintenance -propertyValue "[MY_PROPERTY]" -version "[ProductVersion]" -installLocation "[MY_INSTALL_LOCATION] "' />
<CustomAction Id="CA_AppendTextUsingPowerShell_FirstInstall" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="CA_AppendTextUsingPowerShell_Upgrading" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="CA_AppendTextUsingPowerShell_Uninstalling" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="CA_AppendTextUsingPowerShell_Maintenance" BinaryKey="WixCA" DllEntry="WixQuietExec" Execute="deferred" Return="check" Impersonate="no" />
<InstallExecuteSequence>
<Custom Action='CA_AppendTextUsingPowerShell_FirstInstall' Before='InstallFinalize'>FirstInstall</Custom>
<Custom Action='CA_AppendTextUsingPowerShell_Upgrading' Before='InstallFinalize'>Upgrading</Custom>
<Custom Action='CA_AppendTextUsingPowerShell_Uninstalling' Before='RemoveFiles'>Uninstalling</Custom>
<Custom Action='CA_AppendTextUsingPowerShell_Maintenance' Before='InstallFinalize'>Maintenance</Custom>
</InstallExecuteSequence>
<UI Id="MyWixUI_InstallDir">
<UIRef Id="WixUI_InstallDir" />
<DialogRef Id="MyCustomPropertiesDlg" />
<Publish Dialog="InstallDirDlg" Control="Next" Event="NewDialog" Value="MyCustomPropertiesDlg" Order="4">WIXUI_DONTVALIDATEPATH OR WIXUI_INSTALLDIR_VALID="1"</Publish>
<Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MyCustomPropertiesDlg" Order="1">1</Publish>
</UI>
<Feature Id="HelloWorldFeature">
<ComponentGroupRef Id="ProductComponentGroup" />
</Feature>
</Product>
</Wix>