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 4 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
2 changes: 2 additions & 0 deletions .github/actions/spell-check/expect.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,8 @@ REGISTERCLASSFAILED
REGISTRYHEADER
registrypath
registryroot
registrypreview
REGISTRYPREVIEWEXT
regkey
REGPINTYPES
regroot
Expand Down
3 changes: 2 additions & 1 deletion installer/PowerToysSetup/Common.wxi
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
<?define MeasureToolProjectName="MeasureTool"?>
<?define HostsProjectName="Hosts"?>
<?define PastePlainProjectName="PastePlain"?>

<?define RegistryPreviewProjectName="RegistryPreview"?>

<?define RepoDir="$(var.ProjectDir)..\..\" ?>
<?if $(var.Platform) = x64?>
<?define PowerToysPlatform="x64"?>
Expand Down
1 change: 1 addition & 0 deletions installer/PowerToysSetup/PowerToysInstaller.wixproj
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ call "..\..\..\publish.cmd" arm64
call move /Y ..\..\..\PowerAccent.wxs.bk ..\..\..\PowerAccent.wxs
call move /Y ..\..\..\PowerRename.wxs.bk ..\..\..\PowerRename.wxs
call move /Y ..\..\..\Product.wxs.bk ..\..\..\Product.wxs
call move /Y ..\..\..\RegistryPreview.wxs.bk ..\..\..\RegistryPreview.wxs
call move /Y ..\..\..\Resources.wxs.bk ..\..\..\Resources.wxs
call move /Y ..\..\..\Run.wxs.bk ..\..\..\Run.wxs
call move /Y ..\..\..\Settings.wxs.bk ..\..\..\Settings.wxs
Expand Down
53 changes: 18 additions & 35 deletions installer/PowerToysSetup/RegistryPreview.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -4,49 +4,32 @@

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

<?define RegistryPreviewFiles=ColorCode.Core.dll;ColorCode.WinUI.dll;CommunityToolkit.Common.dll;CommunityToolkit.WinUI.UI.Controls.Core.dll;CommunityToolkit.WinUI.UI.Controls.DataGrid.dll;CommunityToolkit.WinUI.UI.Controls.Input.dll;CommunityToolkit.WinUI.UI.Controls.Layout.dll;CommunityToolkit.WinUI.UI.Controls.Markdown.dll;CommunityToolkit.WinUI.UI.Controls.Media.dll;CommunityToolkit.WinUI.UI.Controls.Primitives.dll;CommunityToolkit.WinUI.UI.dll;CommunityToolkit.WinUI.dll;ControlzEx.dll;Ijwhost.dll;Microsoft.Graphics.Canvas.Interop.dll;Microsoft.Graphics.Canvas.dll;Microsoft.Graphics.Display.dll;Microsoft.InteractiveExperiences.Projection.dll;Microsoft.WinUI.dll;Microsoft.Windows.AppLifecycle.Projection.dll;Microsoft.Windows.AppNotifications.Builder.Projection.dll;Microsoft.Windows.ApplicationModel.DynamicDependency.Projection.dll;Microsoft.Windows.ApplicationModel.Resources.Projection.dll;Microsoft.Windows.ApplicationModel.WindowsAppRuntime.Projection.dll;Microsoft.Windows.SDK.NET.dll;Microsoft.Windows.Security.AccessControl.Projection.dll;Microsoft.Windows.System.Power.Projection.dll;Microsoft.Windows.Widgets.Projection.dll;Microsoft.Windows.Widgets.dll;Microsoft.WindowsAppRuntime.Bootstrap.Net.dll;Microsoft.Xaml.Behaviors.dll;PowerToys.Common.UI.dll;PowerToys.ManagedCommon.dll;PowerToys.ManagedTelemetry.dll;PowerToys.RegistryPreview.deps.json;PowerToys.RegistryPreview.dll;PowerToys.RegistryPreview.exe;PowerToys.RegistryPreview.runtimeconfig.json;PowerToys.RegistryPreviewExt.dll;PowerToys.Settings.UI.Lib.dll;System.CodeDom.dll;System.IO.Abstractions.dll;System.Management.dll;WinRT.Runtime.dll;app.ico;resources.pri?>
<?if $(var.Platform) = x64?>
<?define RegistryPreviewFiles=$(var.RegistryPreviewFiles);clrcompression.dll?>
<?endif?>
<?define RegistryPreviewFiles=?>
<?define RegistryPreviewFilesPath=$(var.BinDir)modules\$(var.RegistryPreviewProjectName)\?>

<?define RegistryPreviewAssets=data32.png;error32.png;folder32.png;string32.png?>
<?define RegistryPreviewAssetsFiles=?>
<?define RegistryPreviewAssetsFilesPath=$(var.BinDir)modules\$(var.RegistryPreviewProjectName)\Assets?>

<Fragment>
<!-- Registry Preview -->
<DirectoryRef Id="RegistryPreviewInstallFolder" FileSource="$(var.BinDir)modules\$(var.RegistryPreviewProjectName)">
<?foreach File in $(var.RegistryPreviewFiles)?>
<Component Id="RegistryPreviewComp_$(var.File)" Win64="yes">
<File Id="RegistryPreviewFile_$(var.File)" Source="$(var.BinDir)modules\$(var.RegistryPreviewProjectName)\$(var.File)" />
</Component>
<?endforeach?>
<DirectoryRef Id="RegistryPreviewInstallFolder" FileSource="$(var.RegistryPreviewFilesPath)">
<!-- Generated by generateFileComponents.ps1 -->
<!--RegistryPreviewFiles_Component_Def-->
</DirectoryRef>

<DirectoryRef Id="RegistryPreviewAssetsInstallFolder" FileSource="$(var.BinDir)modules\$(var.RegistryPreviewProjectName)\Assets">
<?foreach File in $(var.RegistryPreviewAssets)?>
<Component Id="RegistryPreviewAssetsComp_$(var.File)" Win64="yes">
<File Id="RegistryPreviewAssetsFile_$(var.File)" Source="$(var.BinDir)modules\$(var.RegistryPreviewProjectName)\Assets\$(var.File)" />
</Component>
<?endforeach?>
<!-- Files with dash '-' in name listed manually as Component/File ID can'ţcontain dash -->
<Component Id="RegistryPreviewAssetsComp_deleted_folder32.png" Win64="yes">
<File Id="RegistryPreviewAssetsFile_deleted_folder32.png" Source="$(var.BinDir)modules\$(var.RegistryPreviewProjectName)\Assets\deleted-folder32.png" />
</Component>
<Component Id="RegistryPreviewAssetsComp_deleted_value32.png" Win64="yes">
<File Id="RegistryPreviewAssetsFile_deleted_value32.png" Source="$(var.BinDir)modules\$(var.RegistryPreviewProjectName)\Assets\deleted-value32.png" />
</Component>
<DirectoryRef Id="RegistryPreviewAssetsInstallFolder" FileSource="$(var.RegistryPreviewAssetsFilesPath)">
<!-- Generated by generateFileComponents.ps1 -->
<!--RegistryPreviewAssetsFiles_Component_Def-->
</DirectoryRef>


<ComponentGroup Id="RegistryPreviewComponentGroup" Directory="INSTALLFOLDER">
<?foreach File in $(var.RegistryPreviewFiles)?>
<ComponentRef Id="RegistryPreviewComp_$(var.File)" />
<?endforeach?>
<?foreach File in $(var.RegistryPreviewAssets)?>
<ComponentRef Id="RegistryPreviewAssetsComp_$(var.File)" />
<?endforeach?>
<ComponentRef Id="RegistryPreviewAssetsComp_deleted_folder32.png" />
<ComponentRef Id="RegistryPreviewAssetsComp_deleted_value32.png" />

<ComponentGroup Id="RegistryPreviewComponentGroup">
<Component Id="RemoveRegistryPreviewFolder" Guid="D3DBC395-FAC5-44B1-BE44-3FE2B6E0F391" Directory="RegistryPreviewInstallFolder" >
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="RemoveRegistryPreviewFolder" Value="" KeyPath="yes"/>
</RegistryKey>
<RemoveFolder Id="RemoveFolderRegistryPreviewFolder" Directory="RegistryPreviewInstallFolder" On="uninstall"/>
<RemoveFolder Id="RemoveFolderRegistryPreviewAssetsFolder" Directory="RegistryPreviewAssetsInstallFolder" On="uninstall"/>
</Component>
</ComponentGroup>

</Fragment>
Expand Down
4 changes: 4 additions & 0 deletions installer/PowerToysSetup/WinAppSDK.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,9 @@
Id="RegistryPreview_WinAppSDKLoc_$(var.IdSafeLanguage)_Component"
Directory="WinAppSDKLoc$(var.IdSafeLanguage)RegistryPreviewInstallFolder"
Guid="$(var.CompGUIDPrefix)06">
<RegistryKey Root="$(var.RegistryScope)" Key="Software\Classes\powertoys\components">
<RegistryValue Type="string" Name="RegistryPreview_WinAppSDKLoc_$(var.IdSafeLanguage)_Component" Value="" KeyPath="yes"/>
</RegistryKey>
<File Id="RegistryPreview_WinAppSDKLoc_$(var.IdSafeLanguage)_XamlMui_File" Source="$(var.BinDir)modules\$(var.RegistryPreviewProjectName)\$(var.Language)\Microsoft.ui.xaml.dll.mui" />
<File Id="RegistryPreview_WinAppSDKLoc_$(var.IdSafeLanguage)_XamlPhoneMui_File" Source="$(var.BinDir)modules\$(var.RegistryPreviewProjectName)\$(var.Language)\Microsoft.UI.Xaml.Phone.dll.mui" />
</Component>
Expand Down Expand Up @@ -500,6 +503,7 @@
<RemoveFolder Id="RemoveFolderWinAppSDKLoc$(var.IdSafeLanguage)MeasureToolInstallFolder" Directory="WinAppSDKLoc$(var.IdSafeLanguage)MeasureToolInstallFolder" On="uninstall"/>
<RemoveFolder Id="RemoveFolderWinAppSDKLoc$(var.IdSafeLanguage)HostsInstallFolder" Directory="WinAppSDKLoc$(var.IdSafeLanguage)HostsInstallFolder" On="uninstall"/>
<RemoveFolder Id="RemoveFolderWinAppSDKLoc$(var.IdSafeLanguage)FileLocksmithInstallFolder" Directory="WinAppSDKLoc$(var.IdSafeLanguage)FileLocksmithInstallFolder" On="uninstall"/>
<RemoveFolder Id="RemoveFolderWinAppSDKLoc$(var.IdSafeLanguage)RegistryPreviewInstallFolder" Directory="WinAppSDKLoc$(var.IdSafeLanguage)RegistryPreviewInstallFolder" On="uninstall"/>
<?undef IdSafeLanguage?>
<?endforeach?>
</Component>
Expand Down
6 changes: 6 additions & 0 deletions installer/PowerToysSetup/generateAllFileComponents.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,12 @@ Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """
Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""PowerRenameFiles"" -wxsFilePath $PSScriptRoot\PowerRename.wxs -regroot $registryroot"
Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""PowerRenameAssetsFiles"" -wxsFilePath $PSScriptRoot\PowerRename.wxs -regroot $registryroot"

#RegistryPreview
Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\RegistryPreview\PowerToys.RegistryPreview.deps.json"" -fileListName RegistryPreviewFiles -wxsFilePath $PSScriptRoot\RegistryPreview.wxs"
Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName RegistryPreviewAssetsFiles -wxsFilePath $PSScriptRoot\RegistryPreview.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\RegistryPreview\Assets\"""
Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""RegistryPreviewFiles"" -wxsFilePath $PSScriptRoot\RegistryPreview.wxs -regroot $registryroot"
Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""RegistryPreviewAssetsFiles"" -wxsFilePath $PSScriptRoot\RegistryPreview.wxs -regroot $registryroot"

#Run
Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\PowerToys.PowerLauncher.deps.json"" -fileListName launcherFiles -wxsFilePath $PSScriptRoot\Run.wxs"
Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName launcherImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Images"""
Expand Down
2 changes: 1 addition & 1 deletion installer/PowerToysSetup/generateFileList.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ if ($isWinAppSdkProj -eq $True) {
}
}

$fileExclusionList = @("*Test*", "*.pdb", "*.lastcodeanalysissucceeded", "createdump.exe", "backup_restore_settings.json") + $interopFilesList + $winAppSDKfilesList
$fileExclusionList = @("*Test*", "*.pdb", "*.lastcodeanalysissucceeded", "createdump.exe") + $interopFilesList + $winAppSDKfilesList

$fileInclusionList = @("*.dll", "*.exe", "*.json", "*.msix", "*png", "*gif", "*ico", "*cur", "*svg", "index.html", "reg.js", "monacoSpecialLanguages.js", "resources.pri")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\PowerAccent.wxs"" ""$(ProjectDir)..\PowerToysSetup\PowerAccent.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\PowerRename.wxs"" ""$(ProjectDir)..\PowerToysSetup\PowerRename.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Product.wxs"" ""$(ProjectDir)..\PowerToysSetup\Product.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\RegistryPreview.wxs"" ""$(ProjectDir)..\PowerToysSetup\RegistryPreview.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Resources.wxs"" ""$(ProjectDir)..\PowerToysSetup\Resources.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Run.wxs"" ""$(ProjectDir)..\PowerToysSetup\Run.wxs.bk""""
call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Settings.wxs"" ""$(ProjectDir)..\PowerToysSetup\Settings.wxs.bk""""
Expand Down
3 changes: 3 additions & 0 deletions src/common/utils/registry.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ namespace registry
}
}

template<class>
inline constexpr bool always_false_v = false;
yuyoyuppe marked this conversation as resolved.
Show resolved Hide resolved

namespace detail
{
struct on_exit
Expand Down