|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
2 |
| -<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> |
| 2 | +<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension"> |
3 | 3 |
|
4 | 4 | <?define productName="Microsoft Azure PowerShell - November 2015" ?>
|
5 | 5 | <?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
|
|
8 | 8 | <?define version="1.0.1" ?>
|
9 | 9 | <?define versionedStartMenuFolder="Microsoft Azure" ?>
|
10 | 10 | <?define staleStartMenuFolder="Windows Azure" ?>
|
11 |
| - |
| 11 | + |
12 | 12 | <Product Id="*"
|
13 | 13 | Name="$(var.productName)"
|
14 | 14 | Language="1033"
|
|
40 | 40 | </SetProperty>
|
41 | 41 |
|
42 | 42 | <SetProperty Id="POWERSHELLEXE" Value="[WindowsFolder]System32\WindowsPowerShell\v1.0\powershell.exe" Before="AppSearch"/>
|
43 |
| - |
44 |
| - <Property Id="POWERSHELLGETMODULESINSTALLED" > |
45 |
| - <DirectorySearch Id="PROGRAMFILESCONTAINER" Path="[BaseModulesFolder]"> |
46 |
| - <DirectorySearch Id= "PROFILEMODULE" Path="AzureRM.Profile"/> |
47 |
| - </DirectorySearch> |
48 |
| - </Property> |
49 |
| - |
50 |
| - <Property Id="POWERSHELLGETAZUREINSTALLED" > |
51 |
| - <DirectorySearch Id="AZURECONTAINER" Path="[BaseModulesFolder]"> |
52 |
| - <DirectorySearch Id= "AZUREMODULE" Path="Azure"/> |
53 |
| - </DirectorySearch> |
54 |
| - </Property> |
55 |
| - |
56 |
| - <Condition Message="Azure Modules from the PowerShell Gallery are installed on this machine. Please remove these modules before installing this MSI."> |
57 |
| - <![CDATA[Installed or NOT(POWERSHELLGETMODULESINSTALLED >< "AzureRM.Profile")]]> |
58 |
| - </Condition> |
59 |
| - |
60 |
| - <Condition Message="Azure Modules from the PowerShell Gallery are installed on this machine. Please remove these modules before installing this MSI."> |
61 |
| - <![CDATA[Installed or NOT(POWERSHELLGETAZUREINSTALLED >< "Azure")]]> |
62 |
| - </Condition> |
63 |
| - |
| 43 | + |
| 44 | + <util:CloseApplication Id="ClosePowerShellExe" Target="powershell.exe" ElevatedCloseMessage="yes" CloseMessage="yes" PromptToContinue="yes" Description="PowerShell must be closed to continue with this installation. Please close any PowerShell windows and click 'Retry', or click 'Cancel' to stop installation. If you click 'Ignore' the installer will attempt to close any open PowerShell window."/> |
| 45 | + <util:CloseApplication Id="ClosePowerShellIseExe" Target="powershell_ise.exe" ElevatedCloseMessage="yes" CloseMessage="yes" PromptToContinue="yes" Description="PowerShell ISE must be closed to continue with this installation. Please close any PowerShell ISE windows and click 'Retry', or click 'Cancel' to stop installation. If you click 'Ignore' the installer will attempt to close any open PowerShell ISE window."/> |
64 | 46 |
|
65 | 47 | <Condition Message="This setup requires the Windows PowerShell 3.0 or compatible version to be installed.">
|
66 | 48 | <!-- This condition will break if PowerShell has version x3.0 and it is not compatible with 3.0 -->
|
|
88 | 70 | </Directory>
|
89 | 71 |
|
90 | 72 | <Property Id="POWERSHELLPATH">
|
91 |
| - <RegistrySearch Id="POWERSHELLPATH" |
92 |
| - Type="raw" |
93 |
| - Root="HKLM" |
94 |
| - Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine" |
95 |
| - Name="ApplicationBase" /> |
| 73 | + <RegistrySearch Id="POWERSHELLPATH" |
| 74 | + Type="raw" |
| 75 | + Root="HKLM" |
| 76 | + Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine" |
| 77 | + Name="ApplicationBase" /> |
96 | 78 | </Property>
|
97 | 79 |
|
98 | 80 | <DirectoryRef Id="PowerShellFolder">
|
99 | 81 | <Component Id="PSModulePath.System" Guid="273525B9-7AAB-421A-90C8-8E50A1840B8D">
|
100 | 82 | <CreateFolder />
|
101 | 83 | <!-- Work around bug that PowerShell does not always consider default module paths. -->
|
102 | 84 | <Environment Id="PSModulePath.SystemAppRoot" Action="set" Name="PSMODULEPATH" Part="last" Value="[BaseModulesFolder];[PowerShellFolder]ResourceManager\AzureResourceManager;[PowerShellFolder]ServiceManagement" System="yes" />
|
103 |
| - </Component> |
| 85 | + </Component> |
104 | 86 | </DirectoryRef>
|
105 | 87 |
|
106 | 88 | <DirectoryRef Id="PowerShellFolder">
|
|
109 | 91 | </Component>
|
110 | 92 | </DirectoryRef>
|
111 | 93 |
|
| 94 | + <DirectoryRef Id="PowerShellFolder"> |
| 95 | + <Component Id="AzureSdkRemoveModulesScript" Guid="7d75fe67-88e4-40da-bc3d-874cb0438d30"> |
| 96 | + <File Id="AzureSdkRemoveModulesScriptFile" KeyPath="yes" Source="$(var.SolutionDir)\Setup\RemoveGalleryModules.ps1" /> |
| 97 | + </Component> |
| 98 | + </DirectoryRef> |
| 99 | + |
112 | 100 | <DirectoryRef Id="AzureSdkMenu">
|
113 | 101 | <Component Id="AzureSdkShortcut" Guid="A9B58A22-F746-451D-8840-F887D8014C3C">
|
114 | 102 | <Shortcut Id="AzureSdkStartMenuShortcut"
|
|
127 | 115 | <ComponentRef Id="PSModulePath.System" />
|
128 | 116 | <ComponentRef Id="AzureSdkShortcut" />
|
129 | 117 | <ComponentRef Id="AzureSdkExecutionPolicyScript" />
|
130 |
| - </Feature> |
| 118 | + <ComponentRef Id="AzureSdkRemoveModulesScript" /> |
| 119 | + </Feature> |
131 | 120 |
|
132 | 121 | <Binary Id="CustomActions" SourceFile="$(var.caSourceDir)\Microsoft.WindowsAzure.Setup.CA.dll"/>
|
133 | 122 | <CustomAction Id="UpdatePSShortcut" BinaryKey="CustomActions" DllEntry="UpdatePSShortcut" Execute ="deferred" Impersonate="no"/>
|
134 | 123 | <CustomAction Id="SetCustomActionDataValue" Return="check" Property="UpdatePSShortcut"
|
135 | 124 | Value="ShortcutPath=[AzureSdkMenu]Microsoft Azure PowerShell.lnk;DefaultShortcutPath=[ProgramMenuFolder]System Tools\Windows PowerShell.lnk" />
|
136 |
| - <CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -ExecutionPolicy Bypass -Command ". \"[PowerShellFolder]SetExecutionPolicy.ps1\""" Execute="deferred" Impersonate="no" Return="check"/> |
| 125 | + <CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -WindowStyle Hidden -NonInteractive -ExecutionPolicy Bypass -Command ". \"[PowerShellFolder]SetExecutionPolicy.ps1\""" Execute="deferred" Impersonate="no" Return="check"/> |
| 126 | + <CustomAction Id="RemoveGalleryModules" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -WindowStyle Hidden -NonInteractive -ExecutionPolicy Bypass -Command ". \"[PowerShellFolder]RemoveGalleryModules.ps1\""" Execute="deferred" Impersonate="no" Return="check"/> |
137 | 127 |
|
138 | 128 | <InstallExecuteSequence>
|
139 | 129 | <Custom Action="SetCustomActionDataValue" After="CreateShortcuts">NOT Installed</Custom>
|
140 |
| - <Custom Action="UpdatePSShortcut" After="SetCustomActionDataValue">NOT Installed</Custom> |
| 130 | + <Custom Action="RemoveGalleryModules" After="SetCustomActionDataValue">NOT Installed</Custom> |
| 131 | + <Custom Action="UpdatePSShortcut" After="RemoveGalleryModules">NOT Installed</Custom> |
141 | 132 | <Custom Action="SetExecutionPolicy" After="UpdatePSShortcut">NOT Installed</Custom>
|
142 | 133 | </InstallExecuteSequence>
|
143 | 134 |
|
|
0 commit comments