Skip to content

Commit e338f42

Browse files
committed
Change powershell.exe regerence to be system dependent
1 parent 15888f9 commit e338f42

File tree

1 file changed

+6
-17
lines changed

1 file changed

+6
-17
lines changed

setup-powershellget/azurecmd.wxs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
3-
4-
<?if $(var.Platform) != x86 ?>
5-
<?define System32Dir = "System64Folder" ?>
6-
<?else?>
7-
<?define System32Dir = "SystemFolder" ?>
8-
<?endif ?>
9-
3+
104
<?define productName="Microsoft Azure PowerShell - October 2015" ?>
115
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
126
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>
@@ -34,8 +28,6 @@
3428
<Property Id="ALLUSERS" Value="1" />
3529
<!-- per machine install-->
3630

37-
<Property Id="POWERSHELLEXE"><![CDATA[[SystemFolder]\WindowsPowerShell\v1.0\powershell.exe]]></Property>
38-
3931
<Property Id="PSCOMPATIBLEVERSION">
4032
<RegistrySearch Id="PSCOMPATIBLEVERSION" Root="HKLM" Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine" Name="PSCompatibleVersion" Type="raw" />
4133
</Property>
@@ -66,19 +58,17 @@
6658
</Directory>
6759

6860
<Property Id="POWERSHELLPATH">
69-
<RegistrySearch Id="POWERSHELLPATH"
61+
<RegistrySearch Id="POWERSHELLPATH"
7062
Type="raw"
7163
Root="HKLM"
7264
Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine"
7365
Name="ApplicationBase" />
7466
</Property>
7567

68+
<Property Id="POWERSHELLEXE" />
69+
<SetProperty Id="POWERSHELLEXE" Value="[POWERSHELLPATH]\powershell.exe" Before="AppSearch"/>
70+
7671
<DirectoryRef Id="PowerShellFolder">
77-
<Component Id="PSModulePath.System" Guid="273525B9-7AAB-421A-90C8-8E50A1840B8D">
78-
<CreateFolder />
79-
<!-- Work around bug that PowerShell does not always consider default module paths. -->
80-
<!--<Environment Id="PSModulePath.SystemAppRoot" Action="set" Name="PSMODULEPATH" Part="last" Value="[PowerShellFolder]ServiceManagement" System="yes" />-->
81-
</Component>
8272
<Component Id="AzureSdkShortcutScript" Guid="3d0d589a-b34c-4c48-9a4c-df78f286c6a3">
8373
<File Id="AzureSdkShortcutScriptFile" KeyPath="yes" Source="$(var.SolutionDir)\Setup\ShortcutStartup.ps1" />
8474
</Component>
@@ -98,15 +88,14 @@
9888
</DirectoryRef>
9989

10090
<Feature Id="azurecmd" Title="Microsoft Azure PowerShell" Level="1" Description="Windows PowerShell commandlets">
101-
<ComponentRef Id="PSModulePath.System" />
10291
<ComponentRef Id="AzureSdkShortcut" />
10392
<ComponentRef Id="AzureSdkShortcutScript" />
10493
</Feature>
10594

10695
<Binary Id="CustomActions" SourceFile="$(var.caSourceDir)\Microsoft.WindowsAzure.Setup.CA.dll"/>
107-
<CustomAction Id="UpdatePSShortcut" BinaryKey="CustomActions" DllEntry="UpdatePSShortcut" Execute ="deferred" Impersonate="no"/>
10896
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="UpdatePSShortcut"
10997
Value="ShortcutPath=[AzureSdkMenu]Microsoft Azure PowerShell.lnk;DefaultShortcutPath=[ProgramMenuFolder]System Tools\Windows PowerShell.lnk" />
98+
<CustomAction Id="UpdatePSShortcut" BinaryKey="CustomActions" DllEntry="UpdatePSShortcut" Execute ="deferred" Impersonate="no"/>
11099
<CustomAction Id="SetExecutionPolicy" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;Set-ExecutionPolicy RemoteSigned -Force&quot;" Execute="deferred" Impersonate="no" Return="check"/>
111100
<CustomAction Id="RunModuleInstallScript" Property="POWERSHELLEXE" ExeCommand="-NoLogo -NoProfile -Command &quot;. \&quot;[PowerShellFolder]\ShortcutStartup.ps1\&quot; -Install&quot;" Execute="deferred" Impersonate="no" Return="check"/>
112101

0 commit comments

Comments
 (0)