|
16 | 16 | <?define ProductSemanticVersionWithNameAndOptionalArchitecture = "$(var.ProductName) $(env.ProductSemanticVersion) ($(sys.BUILDARCH))"?>
|
17 | 17 | <?define ExplorerContextMenuDialogText = "&$(var.ProductName) $(env.ProductSemanticVersion) ($(sys.BUILDARCH))"?>
|
18 | 18 | <?endif?>
|
| 19 | + <?define ProductDirectoryName = "$(env.ProductDirectoryName)" ?> |
19 | 20 | <?define ProductVersion = "$(env.ProductVersion)" ?>
|
20 | 21 | <?define ProductSemanticVersion = "$(env.ProductSemanticVersion)" ?>
|
21 | 22 | <?define ProductVersionWithName = "$(var.ProductName)_$(var.ProductVersion)"?>
|
|
41 | 42 | <WixVariable Id="WixUIInfoIco" Value="assets\WixUIInfoIco.bmp" />
|
42 | 43 | <Property Id="WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT" Value="Open $(env.ProductName)" />
|
43 | 44 | <!-- Default value of Checkbox of starting PowerShell after installation -->
|
44 |
| - <Property Id="WixShellExecTarget" Value="[$(var.ProductVersionWithName)]pwsh.exe"/> |
| 45 | + <Property Id="WixShellExecTarget" Value="[$(var.ProductDirectoryName)]pwsh.exe"/> |
45 | 46 | <CustomAction Id="LaunchApplication" BinaryKey="WixCA" DllEntry="WixShellExec" Impersonate="yes" />
|
46 | 47 |
|
47 | 48 | <SetProperty Id="RegisterManifest"
|
48 | 49 | Before="RegisterManifest"
|
49 | 50 | Sequence="execute"
|
50 |
| - Value=""[$(var.ProductVersionWithName)]pwsh.exe" -NoProfile -ExecutionPolicy Bypass -File "[$(var.ProductVersionWithName)]RegisterManifest.ps1"" /> |
| 51 | + Value=""[$(var.ProductDirectoryName)]pwsh.exe" -NoProfile -ExecutionPolicy Bypass -File "[$(var.ProductDirectoryName)]RegisterManifest.ps1"" /> |
51 | 52 | <CustomAction Id="RegisterManifest"
|
52 | 53 | BinaryKey="WixCA"
|
53 | 54 | DllEntry="CAQuietExec"
|
|
57 | 58 | <SetProperty Id="EnablePSRemoting"
|
58 | 59 | Before="EnablePSRemoting"
|
59 | 60 | Sequence="execute"
|
60 |
| - Value=""[$(var.ProductVersionWithName)]pwsh.exe" -NoProfile -ExecutionPolicy Bypass -Command "Enable-PSRemoting"" /> |
| 61 | + Value=""[$(var.ProductDirectoryName)]pwsh.exe" -NoProfile -ExecutionPolicy Bypass -Command "Enable-PSRemoting"" /> |
61 | 62 | <CustomAction Id="EnablePSRemoting"
|
62 | 63 | BinaryKey="WixCA"
|
63 | 64 | DllEntry="CAQuietExec"
|
|
109 | 110 | <UIRef Id="CustomWixUI_InstallDir" />
|
110 | 111 | <!-- Features are mandatory. Need At Least One. -->
|
111 | 112 | <Feature Id="ProductFeature" Title="PowerShell" Level="1">
|
112 |
| - <ComponentGroupRef Id="$(var.ProductVersionWithName)"/> |
| 113 | + <ComponentGroupRef Id="$(var.ProductDirectoryName)"/> |
113 | 114 | <ComponentRef Id="ProductVersionFolder"/>
|
114 | 115 | <ComponentRef Id="ApplicationProgramsMenuShortcut"/>
|
115 | 116 | <ComponentRef Id="RegistryEntries"/>
|
|
141 | 142 | <Directory Id="TARGETDIR" Name="SourceDir">
|
142 | 143 | <Directory Id="$(var.ProductProgFilesDir)">
|
143 | 144 | <Directory Id="INSTALLFOLDER" Name="PowerShell">
|
144 |
| - <Directory Id="$(var.ProductVersionWithName)" Name="$(var.ProductSemanticVersion)"> |
| 145 | + <Directory Id="$(var.ProductDirectoryName)" Name="$(var.ProductSemanticVersion)"> |
145 | 146 | <Component Id="ProductVersionFolder" Guid="{e1a7f05e-0cd6-4227-80a8-e4fb311f045c}">
|
146 | 147 | <CreateFolder/>
|
147 | 148 | </Component>
|
|
153 | 154 | </RegistryKey>
|
154 | 155 | <!-- register ourselves in application registry so can be started using just Win+R `pwsh.exe` -->
|
155 | 156 | <RegistryKey Root="HKLM" Key="Software\Microsoft\Windows\CurrentVersion\App Paths\pwsh.exe" ForceCreateOnInstall="yes" ForceDeleteOnUninstall="yes">
|
156 |
| - <RegistryValue Type="string" Value="[$(var.ProductVersionWithName)]pwsh.exe"/> |
| 157 | + <RegistryValue Type="string" Value="[$(var.ProductDirectoryName)]pwsh.exe"/> |
157 | 158 | </RegistryKey>
|
158 | 159 | </Component>
|
159 | 160 | <!-- add ourselves to %PATH% so pwsh.exe can be started from Windows PowerShell or cmd.exe -->
|
|
167 | 168 | <!-- When clicking on background in Explorer -->
|
168 | 169 | <RegistryKey Root="HKCR" Key="Directory\Background\shell\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)">
|
169 | 170 | <RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextMenuDialogText)"/>
|
170 |
| - <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductVersionWithName)]assets\Powershell_black.ico"/> |
| 171 | + <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/> |
171 | 172 | <RegistryValue Type="string" Name="ExtendedSubCommandsKey" Value="Directory\ContextMenus\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)"/>
|
172 | 173 | </RegistryKey>
|
173 | 174 | <!-- When clicking on Drive in Explorer -->
|
174 | 175 | <RegistryKey Root="HKCR" Key="Drive\shell\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)">
|
175 | 176 | <RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextMenuDialogText)"/>
|
176 |
| - <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductVersionWithName)]assets\Powershell_black.ico"/> |
| 177 | + <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/> |
177 | 178 | <RegistryValue Type="string" Name="ExtendedSubCommandsKey" Value="Directory\ContextMenus\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)"/>
|
178 | 179 | </RegistryKey>
|
179 | 180 | <!-- When clicking on Desktop background in Explorer -->
|
180 | 181 | <RegistryKey Root="HKCR" Key="DesktopBackground\shell\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)">
|
181 | 182 | <RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextMenuDialogText)"/>
|
182 |
| - <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductVersionWithName)]assets\Powershell_black.ico"/> |
| 183 | + <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/> |
183 | 184 | <RegistryValue Type="string" Name="ExtendedSubCommandsKey" Value="Directory\ContextMenus\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)"/>
|
184 | 185 | </RegistryKey>
|
185 | 186 | <!-- When clicking on folder in Explorer -->
|
186 | 187 | <RegistryKey Root="HKCR" Key="Directory\shell\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)">
|
187 | 188 | <RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextMenuDialogText)"/>
|
188 |
| - <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductVersionWithName)]assets\Powershell_black.ico"/> |
| 189 | + <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/> |
189 | 190 | <RegistryValue Type="string" Name="ExtendedSubCommandsKey" Value="Directory\ContextMenus\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)"/>
|
190 | 191 | </RegistryKey>
|
191 | 192 | <!-- Sub menus to open PowerShell at the current location either as a normal shell or as Administrator -->
|
192 | 193 | <RegistryKey Root="HKCR" Key="Directory\ContextMenus\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)\shell\open">
|
193 | 194 | <RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextSubMenuDialogText)"/>
|
194 |
| - <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductVersionWithName)]assets\Powershell_black.ico"/> |
| 195 | + <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/> |
195 | 196 | </RegistryKey>
|
196 | 197 | <RegistryKey Root="HKCR" Key="Directory\ContextMenus\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)\shell\open\command">
|
197 |
| - <RegistryValue Type="string" Value="[$(var.ProductVersionWithName)]pwsh.exe -NoExit -Command Set-Location -LiteralPath '%V'"/> |
| 198 | + <RegistryValue Type="string" Value="[$(var.ProductDirectoryName)]pwsh.exe -NoExit -Command Set-Location -LiteralPath '%V'"/> |
198 | 199 | </RegistryKey>
|
199 | 200 | <RegistryKey Root="HKCR" Key="Directory\ContextMenus\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)\shell\runas">
|
200 | 201 | <RegistryValue Type="string" Name="MUIVerb" Value="$(var.ExplorerContextSubMenuElevatedDialogText)"/>
|
201 |
| - <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductVersionWithName)]assets\Powershell_black.ico"/> |
| 202 | + <RegistryValue Type="string" Name="Icon" Value="[$(var.ProductDirectoryName)]assets\Powershell_black.ico"/> |
202 | 203 | <RegistryValue Type="string" Value="" Name="HasLUAShield"/>
|
203 | 204 | </RegistryKey>
|
204 | 205 | <RegistryKey Root="HKCR" Key="Directory\ContextMenus\$(var.ProductName)$(env.ProductSemanticVersion)$(sys.BUILDARCH)\shell\runas\command">
|
205 |
| - <RegistryValue Type="string" Value="[$(var.ProductVersionWithName)]pwsh.exe -NoExit -Command Set-Location -LiteralPath '%V'"/> |
| 206 | + <RegistryValue Type="string" Value="[$(var.ProductDirectoryName)]pwsh.exe -NoExit -Command Set-Location -LiteralPath '%V'"/> |
206 | 207 | </RegistryKey>
|
207 | 208 | </Component>
|
208 | 209 | </Directory>
|
|
214 | 215 | <Shortcut Id="PowerShell_ProgramsMenuShortcut"
|
215 | 216 | Name="$(var.ProductSemanticVersionWithNameAndOptionalArchitecture)"
|
216 | 217 | Description="$(var.ProductSemanticVersionWithNameAndOptionalArchitecture)"
|
217 |
| - Target="[$(var.ProductVersionWithName)]pwsh.exe" |
218 |
| - WorkingDirectory="$(var.ProductVersionWithName)" |
| 218 | + Target="[$(var.ProductDirectoryName)]pwsh.exe" |
| 219 | + WorkingDirectory="$(var.ProductDirectoryName)" |
219 | 220 | Icon = "PowerShellExe.ico" />
|
220 | 221 | <RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
|
221 | 222 | <!-- HKMU is HKLM when installing perMachine and HKCU when installing perUser-->
|
|
0 commit comments