Commit graph

57 commits

Author SHA1 Message Date
Travis Plunk 3a2c164ec6
Refactor MSI code to make it easier to add a WiX EXE installer (#13139) 2020-07-10 10:46:00 -07:00
Travis Plunk d1aa11e367
Fix Path for the Preview MSI (#13070) 2020-07-01 09:56:12 -07:00
Vladimír 9a29cb5cad
Add right-click menu to Run with PowerShell for ps1 scripts (#12970)
Refactor registry WiX configuration for right-click menu.
2020-06-30 15:16:54 -07:00
Travis Plunk 1397deffe4
Correct stable and preview upgrade codes for MSI (#13036)
Co-authored-by: Robert Holt <rjmholt_msft@outlook.com>
Co-authored-by: Aditya Patwardhan <adityap@microsoft.com>
2020-06-29 14:13:10 -07:00
Heath Stewart f7c701c963
Fix MSI upgrade and shortcut issues (#12792)
Co-authored-by: Travis Plunk <travis.plunk@microsoft.com>
2020-05-27 15:45:11 -07:00
xtqqczze 70d9ed4d55 Remove Unicode BOM from text files (#11546) 2020-01-11 12:15:34 +05:00
Steve Lee 146f11b2a1 Add env var to differentiate client/server telemetry in MSI (#10612) 2019-09-24 10:25:58 -07:00
Joey Aiello 0dc216ee7c Switch from BMP to PNG for graphical MSI installer assets (#9606)
This breaks rendering of images for Windows 7 and Server 2008R2,
but it's required for accessibility purposes so that the High
Contrast Black theme renders text correctly for accessibility.
(Unfortunately, BMP does not support transparency.)
2019-05-16 13:24:11 -07:00
Christoph Bergmeister [MVP] f5fc0535ac Preserve user shortcuts pinned to Taskbar during MSI upgrade (#9305)
Fixes #8919 

Preserve user shortcuts pinned to Taskbar during MSI upgrade by not removing shortcuts in this case (assuming the user has not changed the installation directory), see https://stackoverflow.com/a/33402698/1810304
This also requires the Guid to not always be re-generated, which PR #7701 originally added to ensure shortcuts get removed when RTM and preview are installed, the underlying problem was rather that RTM and preview shared the same GUIDs, therefore the GUIDs are hard-coded again but different for RTM and preview, therefore the shortcuts will still always get removed on uninstall. But this also means those GUIDs should change when the default installation directory changes, i.e. in PowerShell 7. Should we write the code to already take this into account that it does not get forgotten?

Tested by first reproducing the issue by building installers locally (and bumping the patch version. Then the fix was applied to verify the solution, it. For this to take effect the version from which an MSI is being upgraded must have this fix already, i.e. if this fix got shipped in `6.2.1`, then on upgrading to it, the issue would still occur but when upgrading `6.2.1` to `6.2.2` the shortcut would start being preserved. I am wondering if we could maybe improve this to show effect earlier by trying to extract the used (auto-generated) GUIDs in the `6.2.0` and `6.2.0-rc` packages out and use them...
Please not that we probably need to take this out for `7.0` because the base installation directory will change. This also assumes that the user has not specified a different installation directory on upgrade but this is a bit of an edge case where I think other things might break as well.
2019-04-07 12:25:56 -07:00
Travis Plunk d7dd4b5dd2
Fix MSI Upgrade failure for preview builds (#9013) 2019-02-28 14:05:27 -08:00
Travis Plunk 51ff0e3e5e
Make license a link in the MSI (#8846) 2019-02-08 14:02:27 -08:00
Steve Lee e7870278c7 Remove duplicate Open Here context menu item upgrading to newer Preview release (#8496)
Remove old `Open` regkey
2018-12-27 14:10:59 +05:00
Steve Lee b7daa796a3 Enable Open Here context menu on Windows to work with root of a drive (#8287)
support being started by Windows Shell (Open Here) where a trailing slash followed by a quote is handled incorrectly
2018-11-19 11:12:40 -08:00
Steve Lee eaa683119d Add title to Open Here window for MSI installer (#8164)
Since we don't explicitly set the window title, it just shows the path to `pwsh.exe`. Fix is to use the `-Command` parameter to set the window title.

Fix #8163
2018-11-01 13:07:45 -07:00
Christoph Bergmeister [MVP] 49826a7a29 Specify verb, pwsh, for shell context menu to avoid overriding the default verb (#7932) 2018-10-04 11:08:15 -07:00
Travis Plunk 172a8a014d
Make sure MSI build works when not preview (#7752)
The variable was set to empty (meaning to delete the variable) in the non-preview case and the build fails.
The fix avoids setting the variable to empty
2018-09-10 14:35:02 -07:00
Christoph Bergmeister [MVP] 9fc964a230 Make Windows MSI uninstallation shortcut remove work when more than one version is installed (#7701)
Fixes underlying problem of #3341. Related: #2881
When multiple versions (e.g. RTM and preview) of PowerShell are installed via the MSI and one is being uninstalled, then the start menu shortcut does not get removed due to the shortcut component being not unique per version. This also applies to an upgrade scenario. Therefore use an auto-generated Guid (`*`)
2018-09-05 13:39:40 -07:00
Steve Lee 1244278e7e [package] (#7345)
enable `pwsh-preview` to work on Windows
2018-07-25 13:32:10 -07:00
Steve Lee b25c1f6cbb When installing using MSI, set the working directory of the shortcut to the user home directory (#7072)
Leverage the -WorkingDirectory parameter on pwsh.exe to set the initial location.

Fix #5705
2018-06-19 18:33:01 -07:00
Christoph Bergmeister 0487a1be2f Disambiguate icon on Windows for preview builds/installers to use Powershell_av_colors and make daily build use Powershell_avatar instead (#7086)
Closes #6317
Using the preview side-by-side with the RTM version is a pain/confusing due to the icons being the same.
This makes the preview build (i.e. the embedded icon in `pwsh.exe`) and MSI installer package (shortcut icon and context menu) use the [Powershell_av_colors icon](https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_av_colors.ico)
![image](https://user-images.githubusercontent.com/9250262/41491336-6e354936-70f0-11e8-965e-9b5e83be925b.png)

Therefore change the icon of the daily build (which used to use the Powershell_av_colors icon) to [Powershell_avatar](https://raw.githubusercontent.com/PowerShell/PowerShell/master/assets/Powershell_avatar.ico)
![image](https://user-images.githubusercontent.com/9250262/41491346-80f890a0-70f0-11e8-9ab5-bb789454c134.png)
This means that people like me who have a shortcut to pwsh of the daily build pinned to the taskbar, probably need to re-pin it to the taskbar to receive all changes (otherwise one will only get the change in the icon of the window)

Note: The `Test-IsPreview` method had to be moved to the build module, which is OK because the packaging module has a declared dependency on the build module in its manifest.
2018-06-18 15:54:11 -07:00
Christoph Bergmeister 16e1823e33 Packaging: Add registry keys to support library folder background for explorer context menu (#6784)
Fixes #6590 by adding registry keys to support the existing explorer context menu also when being inside a library folder. It follows the existing pattern that was already applied to special cases such as drives, Desktop, etc.
Manually Tested on Win 10 1709
Thanks to @mklement0 for triaging the issue and already researching the required registry key (he should also be included in the release notes)
2018-05-02 14:43:25 -07:00
Christoph Bergmeister fa3305534f Use '-WorkingDirectory' parameter to handle context menu when path contains single quotes. (#6660)
Use new '-WorkingDirectory' parameter on pwsh.exe to be able to use context menu when path contains single quotes.
2018-04-24 17:03:14 -07:00
Travis Plunk 77f36498e6
Simplify the paths the MSI uses (#6442)
- Implementation of PowerShell/PowerShell-RFC#115 (If anything changes in the RFC, we will treat it as a bug, and fix it later)
- Update registry and directory paths to use 6 for the version for stable and 6-preview for a preview release
- Add checkbox to set path
- default checkbox to off for preview builds and on for stable builds
2018-04-02 10:47:29 -07:00
Travis Plunk 1730d8c496
MSI: update path with proper value (#6441)
MSI: update path with proper value
- Add verification that path is updated
2018-03-21 12:23:24 -07:00
Travis Plunk f7c2b7def1
MSI: remove the version from the product name (#6415)
MSI: remove the version from the product name

During patching the original MSI information is displayed.
This makes installing a patch for an MSI with a specific version very confusing.
2018-03-20 10:49:01 -07:00
Travis Plunk da905f891b
MSI: Make sure that file components are patchable (#6303)
MSI: Make sure that file components are patchable
- avoid changing names and guids of components between builds as this prevents patch generation
- This required submitting the file generated by heat
- add code to make sure the generated file is not out of date
2018-03-06 10:13:26 -08:00
Travis Plunk 0e276c4e63
Make sure explorer context menu can be patched (#6302)
Make sure explorer context menu can be patched
- set keypath for explorer log context menu
2018-03-05 10:28:56 -08:00
Travis Plunk 7c7ec241a0
MSI: Cause preview builds to install Side by side with release builds (#6301)
MSI: Cause preview builds to install Side by side with release builds
- change the upgrade code if there is a preview part of the version
2018-03-05 10:27:47 -08:00
Travis Plunk 49ec403899
fix MSI creation errors, and capture wixpdb for later patch creation (#6221)
- add `wixpdb` output when creating `MSI` package
- capture `wixpdb` in official build
- clean up anything left behind from previous MSI builds before starting MSI build to prevent using dirty files.
- make sure MSI creation fails if there is an error
- ignore `.wixpdb` files in git
- Add functionality to `Start-NativeExecution` to 
    - only display output if there is an error 
    - log caller information
- WXS validation error fixes
    - Remove unused `ExitDialog` to fix ICE82
    - Add KeyPath to `SetPath` to fix ICE18
    - Use `HKMU` which translates to `HKLM` to runtime to fix various validation errors about creating the shortcut
- Suppress Validation errors
    - suppress ICE61, which is about same version upgrades being allowed
    - suppress ICE57, caused by the shortcut not being installed per user
2018-02-26 15:45:15 -08:00
Christoph Bergmeister fddfb54669 Add options to enable PSRemoting and register Windows Event Logging Manifest to MSI installer (#5999) 2018-02-22 18:07:10 +04:00
Travis Plunk f906e9ddba
Revert PR 6043 - Adds script to patch the shortcut working directory to the user's home folder (#6203)
Revert PR 6043 - Remove failing script from MSI

reverted from commit 795c611
2018-02-21 10:29:29 -08:00
Travis Plunk ca959a735a
change the registry version detection value to semver from the default value (#6192)
change the registry version detection value to semanticversion from the default value
fixes #6171
2018-02-21 10:28:12 -08:00
Travis Plunk fa40a87bd7
Add registry value for easy detection (#6094)
Add registry value for easy detection. For example, the presence of a single key of 6.0.* x64. This is much faster than MSI detection.

Note there are currently two GUIDs, one for 6.0.* x64 and one for 6.0.* x86.

fixes #6090
2018-02-05 10:02:58 -08:00
Chris Duck 795c61125a Adds script to patch the shortcut working directory to the user's home folder. (#6043)
Update the shortcut created by the installer to use %HOMEDRIVE%%HOMEPATH% for the working directory.
2018-01-31 08:11:29 +04:00
Benjamin Staneck 51dbfae0ff Rework Windows Start menu folder name (#5891)
Changes the Windows start menu folder name from ProductSemanticVersionWithName to ProductSemanticVersionWithNameAndOptionalArchitecture - now the start menu is `PowerShell` for all versions.
2018-01-26 08:14:55 +04:00
Christoph Bergmeister d3a775da9a Packaging: simplify building an installable package for Windows (#5871)
This is the continuation of PR 5499 that had to be abandoned due to a fatal merge conflict and I did not want to risk accidentally reverting recent fixes.

    Remove unnecessary/unused default for productGuid because it always gets a new Guid when being called from Start-PSPackage
    Add defaults for required files but also add extra path validation attribute
    Rename ProductGuid to ProductCode
2018-01-17 15:34:03 -08:00
Christoph Bergmeister a07cc49809 Use HKLM instead of HKCU registry keys since the current installation scope is perMachine. (#5915) 2018-01-17 07:09:12 +04:00
Christoph Bergmeister bb09b88390 Fix start menu folder clash of shortcut when x86 and x64 are both installed by appending " (x86)" for x86 to the . (#5826) 2018-01-10 18:18:44 -08:00
Christoph Bergmeister 378e8d5678 Make Explorer context menu registry entries platform specific to allow side by side of x86 and x64. The main menu has a " (x86)" appended to the main menu. (#5824)
Make explorer context menu registry entries platform specific to allow them to work also when both x86 and x64 are installed. The main menu has a " (x86)" appended to the main menu as well.
2018-01-10 08:17:06 +04:00
Christoph Bergmeister f8a5fc1f19 packaging: x86 package gets installed as an x64 component and has the same UpgradeCode as the x64 installer leading to an uninstallation of an x64 installation (and vice versa) (#5812)
Fix bug #5597: x86/x64 installer are uninstalling each other when installing either of them:

-Make x86 installer to be installed as an x86 component (-arch argument to candle.exe, which sets the `sys.BUILDARCH` variable)
-Make the UpgradeCode unique per platform
-Replace `var.ProductTargetArchitecture` variable with sys.BUILDARCH use to have only 1 variable for the architecture
-Additionally, the architecture was appended to the package name to be able to distinguish the installations.
2018-01-08 12:32:38 -08:00
Chris e351a7e5c2 Move checkbox to the top to allow toggling it using the space bar (the Enter key already defaults to the Finish) button. (#5792)
Move definition of Launch PowerShell checkbox to the top to allow toggling it using the spacebar (the Enter key already defaults to the Finish button).
Reuse product name variable.
2018-01-06 11:53:45 +04:00
Chris ceb8f50e43 Add option to add explorer context menu in Windows installer (#5774)
A new dialogue is added in the Windows installer to offer the option of adding explorer.exe context menus to open PowerShell in the current location as a normal shell or as administrator. The context menu entries are achiveven via registry entries and is available when right-clicking on:
- the background of explorer
- a folder in explorer
- a drive in explorer
- on the Desktop
2018-01-05 21:53:19 +04:00
Steve Lee 2cc091115b Rename powershell.exe to pwsh.exe (#5101)
- Rename powershell.exe to pwsh.exe
- Fixe appveyor.psm1
- Update MSI to include 'pwsh' in path and app paths
- Revert change for hyper-v powershell direct
- Update names in packaging.psm1.
- Fix check for SxS
2017-10-17 17:25:11 -07:00
Dongbo Wang f7bab36f5d Fix the prerequisite check of MSI package (#5070)
* Skip check 'vsruntime140.dll' on Win10

* Make the precheck accurate

* Update windows installation prerequisites

* Change 'higher' to 'above'

* Address comments

* Address more comments

* Address some more comments

* [Feature] Update the installer test
2017-10-10 16:40:07 -07:00
Steve Lee ee902a649e New icon for PowerShell Core (#4848)
* added new icon

* added new icon

* update icon to new version of console image with avatar colors

* added svg for blue Windows PowerShell icon

* changed default to the black icon

* added custom bitmaps to the installer

* fixed `launch powershell` checkbox so it shows up more nicely as the default checkbox
has a grey background

also reformatted the xml using a xml formatter to make it easier to read

* address PR feedback
2017-10-03 10:35:32 -07:00
bergmeister da49841f16 Use a simple file based check for the VC++ 2015 redistributables (#4745)
* A simple and minimal fix of 4665 to check for the Visual Studio C++ 2015 redistributables. Note that this is specific to 2015 (vcruntime140.dll refers to the Visual Studio version 14.0, which maps to Visual Studio 2015).
A previous check registry check of 'SOFTWARE\Microsoft\DevDiv\VC\Servicing\14.0\RuntimeMinimum' failed because when the redistributables are installed via Windows update (which does not use MSI), then the registry entry did not get populated.
The 'Pending' attribute was removed from existing tests since the download links are now present again and the tests were improved using Pester TestCases.

* Fixed typo spotted in code review of PR 4745

* Remove DirectorySearch Id duplication by defining it once and referencing according to this special trick in the official WiX documentation here: http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/directorysearchref.html
Renamed property values as suggested.

* Remove replacements of HTTPS with HTTP, i.e. test against exact link. Use -UseBasicParsing switch with the hope of not having failures in the CI environment.
Added comment why there is no assertion about the StatusCode.

* Replace download links with link to pre-requisites page as suggested in PR 4745 because this page is easier to update

* Compilation error CNDL0012 fix: WiX does not allow lowercase characters for file search property Ids because due to them being used for a search property means that they must be public, hence lowercase is not allowed.
2017-09-14 18:42:36 -07:00
Mike Richmond d5521beb18 Remove VCRedist check because it ignores the files installed via KB (#4664) 2017-08-24 15:42:10 -07:00
bergmeister 54e892ab06 Make MSI installer perform pre-requisite checks (#4602)
* #4458 MSI installer checks that the Windows C Runtime and VS Studio 2015 C++ redistributables are present and returns error message if not.
Includes tests to check that the Wix file contains the download URLs and those URLs are not dead.
2017-08-18 12:47:43 -07:00
Steve Lee 06274095ea Enable upgrades rather than side-by-side install (#4259) 2017-07-17 11:12:36 -07:00
bergmeister f95fbf144e Checkbox to open PowerShell after the (Windows) installer has finished (#4203)
Added a checkbox (unchecked by default) to the last dialogue of the Windows installer to provide the option of opening PowerShell because that's what most people want to do if they installed PowerShell.
2017-07-14 18:10:35 -07:00