Skip to content

Commit 678e552

Browse files
committed
Correcting installer to handle cross-architecture module installations
1 parent ffa4897 commit 678e552

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

setup/azurecmd.wxs

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,26 @@
2727
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
2828
<Property Id="ALLUSERS" Value="1" />
2929
<!-- per machine install-->
30-
<CustomAction Id="PropertyAssign" Property="PSGETMODULEPATH" Value="[ProgramFiles6432Folder]WindowsPowerShell\Modules" />
3130
<Property Id="PSCOMPATIBLEVERSION">
3231
<RegistrySearch Id="PSCOMPATIBLEVERSION" Root="HKLM" Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine" Name="PSCompatibleVersion" Type="raw" />
3332
</Property>
3433

34+
<SetProperty Action="SetBase64" Id="BaseModulesFolder" Value="[ProgramFiles64Folder]WindowsPowerShell\Modules" Before="AppSearch">
35+
VersionNT64
36+
</SetProperty>
37+
38+
<SetProperty Action="SetBase32" Id="BaseModulesFolder" Value="[ProgramFilesFolder]WindowsPowerShell\Modules" Before="AppSearch">
39+
NOT VersionNT64
40+
</SetProperty>
41+
3542
<Property Id="POWERSHELLGETMODULESINSTALLED" >
36-
<DirectorySearch Id="AZURERMPROFILEMODULE" Path="[PSGETMODULEPATH]AzureRM.Profile" AssignToProperty="yes"/>
43+
<DirectorySearch Id="PROGRAMFILESCONTAINER" Path="[BaseModulesFolder]">
44+
<DirectorySearch Id= "PROFILEMODULE" Path="AzureRM.Profile"/>
45+
</DirectorySearch>
3746
</Property>
3847

39-
<Condition Message="Azure Resource Manager Modules from the PowerShell Gallery are installed on this machine. Please remove these modules before installing.">
40-
Installed or NOT (POWERSHELLGETMODULESINSTALLED = "[PSGETMODULEPATH]AzureRM.Profile")
48+
<Condition Message="Azure Modules from the PowerShell Gallery are installed on this machine. Please remove these modules before installing this MSI.">
49+
<![CDATA[Installed or NOT(POWERSHELLGETMODULESINSTALLED >< "AzureRM.Profile")]]>
4150
</Condition>
4251

4352

@@ -78,7 +87,7 @@
7887
<Component Id="PSModulePath.System" Guid="273525B9-7AAB-421A-90C8-8E50A1840B8D">
7988
<CreateFolder />
8089
<!-- Work around bug that PowerShell does not always consider default module paths. -->
81-
<Environment Id="PSModulePath.SystemAppRoot" Action="set" Name="PSMODULEPATH" Part="last" Value="[PSGETMODULEPATH];[PowerShellFolder]ResourceManager;[PowerShellFolder]ServiceManagement" System="yes" />
90+
<Environment Id="PSModulePath.SystemAppRoot" Action="set" Name="PSMODULEPATH" Part="last" Value="[BaseModulesFolder];[PowerShellFolder]ResourceManager;[PowerShellFolder]ServiceManagement" System="yes" />
8291
</Component>
8392
</DirectoryRef>
8493

0 commit comments

Comments
 (0)