Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[installer] Support per-user installation #24087

Merged
merged 21 commits into from
Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
65a7b88
Add per user installer
stefansjfw Jan 18, 2023
14f36cb
Separate upgrade codes for per machine and per user installation
stefansjfw Feb 8, 2023
a2eac05
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Feb 22, 2023
03ea420
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 7, 2023
34545da
Update installer/PowerToysSetup/generateFileList.ps1
stefansjfw Mar 7, 2023
f44ccca
Update installer/PowerToysSetup/generateAllFileComponents.ps1
stefansjfw Mar 7, 2023
4ba537d
Update installer/PowerToysSetup/generateFileList.ps1
stefansjfw Mar 7, 2023
9bc160f
expect.txt
stefansjfw Mar 7, 2023
68b2f57
Revert "Update installer/PowerToysSetup/generateFileList.ps1"
stefansjfw Mar 7, 2023
30af633
Update release CI to build both installers
stefansjfw Feb 23, 2023
8fc9014
Revert bundle name change
stefansjfw Mar 14, 2023
665a306
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 21, 2023
7235d87
spellcheck
stefansjfw Mar 21, 2023
7d983db
Fix bad merge
stefansjfw Mar 24, 2023
bf0e514
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 27, 2023
7357213
Add RegistryPreview
stefansjfw Mar 27, 2023
29ce624
Include backup_restore_settings.json
stefansjfw Mar 27, 2023
5373de9
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 28, 2023
2512cbf
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 29, 2023
98d3233
Merge remote-tracking branch 'origin/main' into stefan/per_user_instal
stefansjfw Mar 30, 2023
01f83f4
Revert testing endpoint change
stefansjfw Mar 30, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
190 changes: 177 additions & 13 deletions .github/actions/spell-check/expect.txt

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,3 @@ src/common/Telemetry/*.etl
/src/modules/previewpane/SvgThumbnailProvider/$(SolutionDir)$(Platform)/$(Configuration)/modules/FileExplorerPreview/SvgThumbnailProvider.xml
/src/modules/powerrename/ui/RCa24464
/src/modules/powerrename/ui/RCb24464

# Generated installer file for Monaco source files.
/installer/PowerToysSetup/MonacoSRC.wxs
1 change: 1 addition & 0 deletions .pipelines/ESRPSigning_core.json
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@
"modules\\FileExplorerPreview\\Microsoft.Web.WebView2.Wpf.dll",
"modules\\FileExplorerPreview\\WebView2Loader.dll",
"modules\\Hosts\\Microsoft.Graphics.Canvas.Interop.dll",
"modules\\Hosts\\clrcompression.dll",
"modules\\launcher\\e_sqlite3.dll",
"modules\\launcher\\LazyCache.dll",
"modules\\launcher\\SQLitePCLRaw.batteries_v2.dll",
Expand Down
41 changes: 39 additions & 2 deletions .pipelines/ci/templates/build-powertoys-steps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ steps:
filePath: '$(build.sourcesdirectory)\.pipelines\installWiX.ps1'

- task: VSBuild@1
displayName: 'Build PowerToys MSI'
displayName: 'Build PowerToys per-machine MSI'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
Expand All @@ -163,7 +163,7 @@ steps:
maximumCpuCount: true

- task: VSBuild@1
displayName: 'Build PowerToys Bootstrapper'
displayName: 'Build PowerToys per-machine Bootstrapper'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
Expand All @@ -173,6 +173,43 @@ steps:
clean: false
maximumCpuCount: true

- task: PowerShell@2
displayName: Clean installer dir before building per-user installer
inputs:
targetType: inline
script: git clean -xfd -e *exe -- .\installer\
pwsh: true

- task: NuGetCommand@2
displayName: Restore NuGet packages for PowerToysSetup.sln
inputs:
command: restore
feedsToUse: config
configPath: NuGet.config
restoreSolution: installer\PowerToysSetup.sln
restoreDirectory: '$(Build.SourcesDirectory)\installer\packages'

- task: VSBuild@1
displayName: 'Build PowerToys per-user MSI'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: /t:PowerToysInstaller ${{ parameters.additionalBuildArguments }} /p:PerUser=true
maximumCpuCount: true

- task: VSBuild@1
displayName: 'Build PowerToys per-user Bootstrapper'
inputs:
solution: '**\installer\PowerToysSetup.sln'
vsVersion: 17.0
platform: '$(BuildPlatform)'
configuration: '$(BuildConfiguration)'
msbuildArgs: /t:PowerToysBootstrapper ${{ parameters.additionalBuildArguments }} /p:PerUser=true
clean: false
maximumCpuCount: true

# directly not doing WinAppDriver testing
- task: VSTest@2
displayName: 'MS Tests'
Expand Down
6 changes: 4 additions & 2 deletions .pipelines/versionAndSignCheck.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ $items | ForEach-Object {
(-not $_.Name.EndsWith("Microsoft.Xaml.Interactions.dll")) -and
(-not $_.Name.EndsWith("Microsoft.Xaml.Interactivity.dll")) -and
(-not $_.Name.EndsWith("hyjiacan.py4n.dll")) -and
(-not $_.Name.EndsWith("Microsoft.WindowsAppRuntime.Release.Net.dll"))
(-not $_.Name.EndsWith("Microsoft.WindowsAppRuntime.Release.Net.dll")) -and
(-not $_.Name.EndsWith("Microsoft.Windows.Widgets.Projection.dll"))
)
{
Write-Host "Version set to 1.0.0.0: " + $_.FullName
Expand All @@ -63,7 +64,8 @@ $items | ForEach-Object {
(-not $_.Name.EndsWith("MRM.dll")) -and
(-not $_.Name.EndsWith("PushNotificationsLongRunningTask.ProxyStub.dll")) -and
(-not $_.Name.EndsWith("WindowsAppSdk.AppxDeploymentExtensions.Desktop.dll")) -and
(-not $_.Name.EndsWith("System.Diagnostics.EventLog.Messages.dll"))
(-not $_.Name.EndsWith("System.Diagnostics.EventLog.Messages.dll")) -and
(-not $_.Name.EndsWith("Microsoft.Windows.Widgets.dll"))
)
{
Write-Host "Version not set: " + $_.FullName
Expand Down
23 changes: 12 additions & 11 deletions installer/PowerToysSetup/AlwaysOnTop.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,22 @@

<?include $(sys.CURRENTDIR)\Common.wxi?>

<?define AlwaysOnTopFiles=?>
<?define AlwaysOnTopFilesPath=$(var.BinDir)modules\$(var.AlwaysOnTopProjectName)\?>

<Fragment>
<!-- AlwaysOnTop -->
<DirectoryRef Id="AlwaysOnTopInstallFolder" FileSource="$(var.BinDir)modules\$(var.AlwaysOnTopProjectName)">
<Component Id="Module_AlwaysOnTopInterface" Win64="yes">
<File Source="$(var.BinDir)modules\$(var.AlwaysOnTopProjectName)\PowerToys.AlwaysOnTopModuleInterface.dll" />
</Component>
<Component Id="Module_AlwaysOnTop" Win64="yes">
<File Source="$(var.BinDir)modules\$(var.AlwaysOnTopProjectName)\PowerToys.AlwaysOnTop.exe" />
</Component>

<!-- Generated by generateFileComponents.ps1 -->
<!--AlwaysOnTopFiles_Component_Def-->
</DirectoryRef>

<ComponentGroup Id="AlwaysOnTopComponentGroup" Directory="INSTALLFOLDER">
<ComponentRef Id="Module_AlwaysOnTop"/>
<ComponentRef Id="Module_AlwaysOnTopInterface"/>
<ComponentGroup Id="AlwaysOnTopComponentGroup">
<Component Id="RemoveAOTFolder" Guid="9966E305-C8B9-43D8-9F4A-30CD0E3746A5" Directory="AlwaysOnTopInstallFolder" >
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="RemoveAOTFolder" Value="" KeyPath="yes"/>
</RegistryKey>
<RemoveFolder Id="RemoveFolderAOTFolder" On="uninstall"/>
</Component>
</ComponentGroup>

</Fragment>
Expand Down
30 changes: 16 additions & 14 deletions installer/PowerToysSetup/Awake.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -4,29 +4,31 @@

<?include $(sys.CURRENTDIR)\Common.wxi?>

<?define AwakeFiles=PowerToys.AwakeModuleInterface.dll;PowerToys.ManagedCommon.dll;System.Management.dll;System.CodeDom.dll;System.Text.Json.dll;PowerToys.ManagedTelemetry.dll;PowerToys.Settings.UI.Lib.dll;NLog.config;NLog.dll;PowerToys.Awake.deps.json;PowerToys.Awake.dll;PowerToys.Awake.exe;PowerToys.Awake.runtimeconfig.json;System.CommandLine.dll;System.IO.Abstractions.dll;System.Reactive.dll;System.Runtime.Caching.dll;Ijwhost.dll;Microsoft.Windows.SDK.NET.dll;WinRT.Runtime.dll;PowerToys.GPOWrapper.dll;WindowsBase.dll?>
<?define AwakeFiles=?>
<?define AwakeFilesPath=$(var.BinDir)modules\$(var.AwakeProjectName)\?>
<?define AwakeImagesFiles=?>
<?define AwakeImagesFilesPath=$(var.BinDir)modules\$(var.AwakeProjectName)\Images?>

<Fragment>
<!-- Awake -->
<DirectoryRef Id="AwakeInstallFolder" FileSource="$(var.BinDir)modules\$(var.AwakeProjectName)">
<!-- !Warning! Make sure to change Component Guid if you update the file list -->
<Component Id="Module_Awake" Guid="0D571D9A-743B-4CC5-9297-F0289FBE3398" Win64="yes">
<?foreach File in $(var.AwakeFiles)?>
<File Id="AwakeFile_$(var.File)" Source="$(var.BinDir)modules\$(var.AwakeProjectName)\$(var.File)" />
<?endforeach?>
</Component>
<!-- Generated by generateFileComponents.ps1 -->
<!--AwakeFiles_Component_Def-->
</DirectoryRef>

<!-- Awake images -->
<DirectoryRef Id="AwakeImagesFolder" FileSource="$(var.BinDir)modules\$(var.AwakeProjectName)\Images">
<Component Id="Module_Awake_Images" >
<File Id="Awake_Awake.ico" Source="$(var.BinDir)modules\$(var.AwakeProjectName)\Images\Awake.ico" />
</Component>
<!-- Generated by generateFileComponents.ps1 -->
<!--AwakeImagesFiles_Component_Def-->
</DirectoryRef>

<ComponentGroup Id="AwakeComponentGroup" Directory="INSTALLFOLDER">
<ComponentRef Id="Module_Awake"/>
<ComponentRef Id="Module_Awake_Images"/>
<ComponentGroup Id="AwakeComponentGroup">
<Component Id="RemoveAwakeFolder" Guid="95D7774C-69A3-48A3-B417-1BD9664BE974" Directory="AwakeInstallFolder" >
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="RemoveAwakeFolder" Value="" KeyPath="yes"/>
</RegistryKey>
<RemoveFolder Id="RemoveFolderAwakeFolder" Directory="AwakeInstallFolder" On="uninstall"/>
<RemoveFolder Id="RemoveFolderAwakeImagesFolder" Directory="AwakeImagesFolder" On="uninstall"/>
</Component>
</ComponentGroup>

</Fragment>
Expand Down
38 changes: 18 additions & 20 deletions installer/PowerToysSetup/ColorPicker.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,31 @@

<?include $(sys.CURRENTDIR)\Common.wxi?>

<?define ColorPickerFiles=PowerToys.ColorPicker.dll;System.IO.Abstractions.dll;System.CodeDom.dll;System.Text.Json.dll;PowerToys.ColorPickerUI.exe;PowerToys.ColorPickerUI.dll;PowerToys.ColorPickerUI.deps.json;PowerToys.ColorPickerUI.runtimeconfig.json;PowerToys.Settings.UI.Lib.dll;PowerToys.ManagedTelemetry.dll;PowerToys.ManagedCommon.dll;System.Management.dll;ControlzEx.dll;Microsoft.Xaml.Behaviors.dll;ModernWpf.Controls.dll;ModernWpf.dll;System.ComponentModel.Composition.dll;PowerToys.Common.UI.dll;WinRT.Runtime.dll;Microsoft.Windows.SDK.NET.dll;Ijwhost.dll;PowerToys.GPOWrapper.dll;PowerToys.GPOWrapperProjection.dll;WindowsBase.dll?>
<?define ColorPickerFiles=?>
<?define ColorPickerFilesPath=$(var.BinDir)modules\$(var.ColorPickerProjectName)\?>
<?define ColorPickerResourcesFiles=?>
<?define ColorPickerResourcesFilesPath=$(var.BinDir)modules\$(var.ColorPickerProjectName)\Resources\?>

<Fragment>
<!-- Color Picker -->
<DirectoryRef Id="ColorPickerInstallFolder" FileSource="$(var.BinDir)modules\$(var.ColorPickerProjectName)">
<!-- !Warning! Make sure to change Component Guid if you update the file list -->
<Component Id="Module_ColorPicker" Guid="963A986E-289D-45CC-BC6B-9A2C9EF3DB33" Win64="yes">
<?foreach File in $(var.ColorPickerFiles)?>
<File Id="ColorPickerFile_$(var.File)" Source="$(var.BinDir)modules\$(var.ColorPickerProjectName)\$(var.File)" />
<?endforeach?>
</Component>
<DirectoryRef Id="ColorPickerInstallFolder" FileSource="$(var.ColorPickerFilesPath)">
<!-- Generated by generateFileComponents.ps1 -->
<!--ColorPickerFiles_Component_Def-->
</DirectoryRef>

<!-- Color Picker Resources -->
<DirectoryRef Id="ColorPickerResourcesFolder" FileSource="$(var.BinDir)modules\$(var.ColorPickerProjectName)\Resources">
<Component Id="Module_ColorPicker_Cursor">
<File Id="ColorPickerFile_colorPicker.cur" Source="$(var.BinDir)modules\$(var.ColorPickerProjectName)\Resources\colorPicker.cur" />
</Component>
<Component Id="Module_ColorPicker_Icon">
<File Id="ColorPickerFile_icon.ico" Source="$(var.BinDir)modules\$(var.ColorPickerProjectName)\Resources\icon.ico" />
</Component>
<DirectoryRef Id="ColorPickerResourcesFolder" FileSource="$(var.ColorPickerResourcesFilesPath)">
<!-- Generated by generateFileComponents.ps1 -->
<!--ColorPickerResourcesFiles_Component_Def-->
</DirectoryRef>

<ComponentGroup Id="ColorPickerComponentGroup" Directory="INSTALLFOLDER">
<ComponentRef Id="Module_ColorPicker" />
<ComponentRef Id="Module_ColorPicker_Icon"/>
<ComponentRef Id="Module_ColorPicker_Cursor"/>
<ComponentGroup Id="ColorPickerComponentGroup">
<Component Id="RemoveColorPickerFolder" Guid="18C0C18C-F38A-4C88-B22C-9222F3A5B2EB" Directory="ColorPickerInstallFolder" >
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="RemoveColorPickerFolder" Value="" KeyPath="yes"/>
</RegistryKey>
<RemoveFolder Id="RemoveFolderColorPickerFolder" Directory="ColorPickerInstallFolder" On="uninstall"/>
<RemoveFolder Id="RemoveFolderColorPickerResourcesFolder" Directory="ColorPickerResourcesFolder" On="uninstall"/>
</Component>
</ComponentGroup>

</Fragment>
Expand Down
37 changes: 33 additions & 4 deletions installer/PowerToysSetup/Common.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,40 @@

<?define RepoDir="$(var.ProjectDir)..\..\" ?>
<?if $(var.Platform) = x64?>
<?define PlatformLK="x64" ?>
<?define BinDir="$(var.RepoDir)x64\$(var.Configuration)\" ?>
<?define PowerToysPlatform="x64"?>
<?define PlatformProgramFiles="[ProgramFiles64Folder]"?>
<?define PlatformLK="x64" ?>
<?define BinDir="$(var.RepoDir)x64\$(var.Configuration)\" ?>
<?else?>
<?define PlatformLK="arm64" ?>
<?define BinDir="$(var.RepoDir)ARM64\$(var.Configuration)\" ?>
<!-- stable WIX 3 doesn't support ARM64, so we build installers as x86 -->
<?define PowerToysPlatform="ARM64"?>
<!--TODO: define to ARM64 Program files once it's available-->
<?define PlatformProgramFiles="[ProgramFiles6432Folder]"?>
<?define PlatformLK="arm64" ?>
<?define BinDir="$(var.RepoDir)ARM64\$(var.Configuration)\" ?>
<?endif?>

<?if $(var.PerUser) = "true"?>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is setting this? Installer parameter? For enterprise usage I think two things are required: Allow forcing machine install and blocking user install using a GPO. (Cc: @jaimecbernardo for the GPO.)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Allow forcing machine install

This is a build argument. There will be 2 separate installers. Like for VSCode.

blocking user install using a GPO

Good point.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefansjfw
The PR #24221 implements a new GPO category where you can add your installer GPO. ;-)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blocking user install using a GPO

Good point.

What about the GPO. Will this be a second PR?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's on TODO list, It'll probably go as a follow-up PR

<?define BundleName="PowerToys (Preview) $(var.PowerToysPlatform) User"?>
<?define PerMachineYesNo="no"?>
<?define MSIPath="UserSetup"?>
<?define MSIName="PowerToysUserSetup-$(var.Version)-$(var.PowerToysPlatform).msi"?>
<?define DefaultInstallDir="LocalAppDataFolder" ?>
<?define RegistryScope="HKCU" ?>
<?define InstallScope="perUser" ?>
<?define InstallPrivileges="limited" ?>
<?define UpgradeCodeGUID="D8B559DB-4C98-487A-A33F-50A8EEE42726" ?>
<?else?>
<?define BundleName="PowerToys (Preview) $(var.PowerToysPlatform)"?>
<?define PerMachineYesNo="yes"?>
<?define MSIPath="MachineSetup"?>
<?define MSIName="PowerToysSetup-$(var.Version)-$(var.PowerToysPlatform).msi"?>
<?define DefaultInstallDir="ProgramFiles64Folder" ?>
<?define RegistryScope="HKLM" ?>
<?define InstallScope="perMachine" ?>
<?define InstallPrivileges="elevated" ?>
<?define UpgradeCodeGUID="42B84BF7-5FBF-473B-9C8B-049DC16F7708" ?>
<?endif?>

<?define BinX32Dir="$(var.RepoDir)x86\$(var.Configuration)\" ?>
</Include>
Loading