From 870f8e35718323b34444ad57b59410225accc9cc Mon Sep 17 00:00:00 2001 From: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Date: Fri, 31 Mar 2023 12:23:57 +0200 Subject: [PATCH] [installer] Support per-user installation (#24087) * Add per user installer * Separate upgrade codes for per machine and per user installation Move per machine check to bootstrapper Move all defines to common.wxs Fix CI * Update installer/PowerToysSetup/generateFileList.ps1 Co-authored-by: Jeremy Sinclair <4016293+snickler@users.noreply.github.com> * Update installer/PowerToysSetup/generateAllFileComponents.ps1 Co-authored-by: Jeremy Sinclair <4016293+snickler@users.noreply.github.com> * Update installer/PowerToysSetup/generateFileList.ps1 Co-authored-by: Jeremy Sinclair <4016293+snickler@users.noreply.github.com> * expect.txt * Revert "Update installer/PowerToysSetup/generateFileList.ps1" This reverts commit 34545dab9cec642eccf790f9daf99e522293fb1f. * Update release CI to build both installers * Revert bundle name change It messes up app ID for per-user installation which ends up breaking winget update of the per-user PT * spellcheck * Fix bad merge * Add RegistryPreview * Include backup_restore_settings.json * Revert testing endpoint change --------- Co-authored-by: Jeremy Sinclair <4016293+snickler@users.noreply.github.com> --- .github/actions/spell-check/expect.txt | 195 ++- .gitignore | 3 - .pipelines/ESRPSigning_core.json | 1 + .pipelines/ESRPSigning_installer.json | 4 +- .../ci/templates/build-powertoys-steps.yml | 41 +- .pipelines/installer-steps.yml | 141 +++ .pipelines/release.yml | 185 +-- .pipelines/versionAndSignCheck.ps1 | 2 +- installer/PowerToysSetup/AlwaysOnTop.wxs | 25 +- installer/PowerToysSetup/Awake.wxs | 30 +- installer/PowerToysSetup/ColorPicker.wxs | 38 +- installer/PowerToysSetup/Common.wxi | 35 +- installer/PowerToysSetup/Core.wxs | 103 +- installer/PowerToysSetup/FancyZones.wxs | 22 +- .../PowerToysSetup/FileExplorerPreview.wxs | 41 +- installer/PowerToysSetup/FileLocksmith.wxs | 70 +- installer/PowerToysSetup/Hosts.wxs | 79 +- installer/PowerToysSetup/ImageResizer.wxs | 154 ++- installer/PowerToysSetup/KeyboardManager.wxs | 25 +- installer/PowerToysSetup/MeasureTool.wxs | 47 +- installer/PowerToysSetup/MonacoSRC.wxs | 1059 +++++++++++++++++ installer/PowerToysSetup/MouseUtils.wxs | 49 +- installer/PowerToysSetup/PastePlain.wxs | 15 +- installer/PowerToysSetup/PowerAccent.wxs | 22 +- installer/PowerToysSetup/PowerRename.wxs | 73 +- installer/PowerToysSetup/PowerToys.wxs | 44 +- .../PowerToysBootstrapper.wixproj | 14 +- .../PowerToysSetup/PowerToysInstaller.wixproj | 70 +- installer/PowerToysSetup/Product.wxs | 37 +- installer/PowerToysSetup/RegistryPreview.wxs | 53 +- installer/PowerToysSetup/Resources.wxs | 162 +++ installer/PowerToysSetup/Run.wxs | 631 +++++----- installer/PowerToysSetup/Settings.wxs | 151 +-- installer/PowerToysSetup/ShortcutGuide.wxs | 43 +- installer/PowerToysSetup/TextExtractor.wxs | 22 +- installer/PowerToysSetup/Tools.wxs | 25 +- installer/PowerToysSetup/VideoConference.wxs | 23 +- installer/PowerToysSetup/WinAppSDK.wxs | 167 ++- .../generateAllFileComponents.ps1 | 214 ++++ .../PowerToysSetup/generateFileComponents.ps1 | 56 + installer/PowerToysSetup/generateFileList.ps1 | 84 ++ .../CustomAction.cpp | 6 +- .../PowerToysSetupCustomActions.vcxproj | 33 +- src/common/updating/updating.cpp | 12 +- src/common/updating/updating.h | 1 + src/common/updating/updating.vcxproj | 1 + src/common/utils/MsiUtils.h | 6 +- src/common/utils/registry.h | 77 ++ 48 files changed, 3263 insertions(+), 1128 deletions(-) create mode 100644 .pipelines/installer-steps.yml create mode 100644 installer/PowerToysSetup/MonacoSRC.wxs create mode 100644 installer/PowerToysSetup/generateAllFileComponents.ps1 create mode 100644 installer/PowerToysSetup/generateFileComponents.ps1 create mode 100644 installer/PowerToysSetup/generateFileList.ps1 diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 69df4fe631..2c780296c4 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -1,14 +1,27 @@ aaaa +AAAAEF +AAB +AABAD +AACB +AACD +AAD +AADF +abap +ABE abgr abi ABlocked ABOUTBOX Abug +ACA accctrl Acceleratorkeys ACCEPTFILES ACCESSDENIED accessibilityinsights +ACDB +ACFC +ACFF Acl aclapi AColumn @@ -24,7 +37,18 @@ adml admx advapi advfirewall +AEAA +AEAD +AECC +AED +AEE +AEEB +AFAE +AFAEFC +AFDA +AFE AFeature +AFFE AFFINETRANSFORM AFX AGGREGATABLE @@ -49,6 +73,7 @@ ansicolor ANull AOC aocfnapldcnfbofgmbbllojgocaelgdd +AOT APARTMENTTHREADED APeriod APIENTRY @@ -62,7 +87,6 @@ Applets Applicationcan applicationconfiguration applicationframehost -Applist applog appmanifest APPNAME @@ -110,13 +134,36 @@ AValid awakeness awakeversion AYUV +azcli azman +azor backtracer +BAF bak +BBE bbwe +BCA +BCB +BCCE +BCCEA bck +BDB +BDBAD +BDCC +BDDF +BDFB +BEAA +BEB +BEEAADF +BEEC +BEFA betadele betsegaw +BFC +BFDE +BFEB +BFF +BFFA BGR bgra bhid @@ -169,28 +216,46 @@ BUTTONUP BValue BYPOSITION bytearray +CABD CALG callbackptr +cameligo Cangjie CANRENAME CAPTUREBLT CAPTURECHANGED CAtl +CBA +CBB +CBF +CCCCDE cch CCHDEVICENAME -CCHDEVICENAME -CCHFORMNAME CCHFORMNAME CCom CContext +CDAC +CDBF +CDCE +CDD +CDE cdecl CDeclaration CDEF cdpx +CEAF +CEBAC +CEBD +CECB CENTERALIGN ceq certlm certmgr +CFAADB +CFBBF +CFEE +CFFEE +CFFF cguid changecursor Changemove @@ -199,7 +264,7 @@ CHILDACTIVATE CHILDWINDOW chrdavis Chrzan -cht +CHT CIELAB CIEXYZ cim @@ -290,6 +355,7 @@ cppruntime cppstd cppwinrt CProj +createdump CREATESCHEDULEDTASK CREATESTRUCT CREATEWINDOWFAILED @@ -304,7 +370,6 @@ CSRW CStyle CSY CTest -Ctl CTRLALTDEL Ctrls Ctx @@ -324,14 +389,15 @@ cxfksword CXSCREEN CXSMICON CXVIRTUALSCREEN -cxxopts cyberrex CYSCREEN CYSMICON CYVIRTUALSCREEN cziplib +DAA Dac dacl +DAF damienleroy DARKPURPLE DARKTEAL @@ -342,12 +408,21 @@ dataversion DATAW davidegiacometti Dayof +DBAE +DBB +DBBDA +DBDE Dbg Dbghelp DBLCLKS DBLEPSILON +DCAB DCapture DCBA +DCBC +DCCB +DCEFCB +DCF DCOM dcommon dcomp @@ -356,6 +431,8 @@ DCompiler DComposition DCR DCs +DDCDD +DDCE DDevice ddf DDxgi @@ -364,6 +441,7 @@ debian debugbreak DECLAR declspec +DED Dedup DEFAULTBOOTSTRAPPERINSTALLFOLDER DEFAULTCOLOR @@ -391,16 +469,18 @@ DESKTOPABSOLUTEEDITING DESKTOPABSOLUTEPARSING desktopshorcutinstalled desktopwindowxamlsource -deu +DEU devblogs devdocs devenum devmgmt DEVMODEW -DEVMODEW DEVMON devpkey DEVSOURCE +DFAB +DFB +DFBEA DIIRFLAG dimm directshow @@ -465,13 +545,41 @@ dxgi dxgidebug dxgiformat dxguid +EAAFE +EABF +EAC +EADC +EAF +EBCF +EBD +EBE +ecl ecount EData +EDB +EDCCC +EDFAE Edid +edis EDITKEYBOARD editkeyboardwindow EDITSHORTCUTS editshortcutswindow +edshift +EEA +EEB +EEBBE +EEBD +EED +EEDA +EEEE +EEF +EEFA +EFB +EFC +EFDD +EFE +EFFEFC EFile egfile ekus @@ -483,7 +591,7 @@ ENABLEDPOPUP endpointvolume endregion ENTERSIZEMOVE -enu +ENU EOAC epicgames epu @@ -495,8 +603,8 @@ ERRORLEVEL ERRORTITLE ESettings esize -esn esrp +estructuredtext etl etw EUQ @@ -530,7 +638,11 @@ exstyle EXTENDEDKEY EXTENDEDVERBS eyetracker +FABC fabricbot +FAEDDA +FAF +FAFD fancymouse fancyzone fancyzones @@ -538,8 +650,35 @@ FANCYZONESDRAWLAYOUTTEST FANCYZONESEDITOR Farbraum FARPROC +FBB +FBC +FBDE +FBF +FCAE +FCB +FCCFF +FCD +FCDB +FCDD +FCE +FDB +FDBF +FDC +FDCD +FDE +FDEF +FDF fdw +FECF +FEDF +FEEF feimage +FFB +FFBCF +FFBE +FFDDD +FFEB +FFEBEF fff fileapi FILEEXPLORER @@ -602,7 +741,6 @@ GETSTATE GETTEXT GETTEXTLENGTH GHND -Globbing GMEM GNumber google @@ -610,6 +748,7 @@ gpedit gpo GPT gpu +graphql GSM gtm gui @@ -783,6 +922,7 @@ INSTALLFOLDERTOPREVIOUSINSTALLFOLDER INSTALLLOCATION INSTALLMESSAGE INSTALLPROPERTY +installscopeperuser INSTALLSTARTMENUSHORTCUT INSTALLSTATE Inste @@ -823,10 +963,11 @@ jgeosdfsdsgmkedfgdfgdfgbkmhcgcflmi jjw jobject jpe -jpn +JPN jpnime Jsons jsonval +julia junja jxr jyuwono @@ -848,14 +989,17 @@ keynum keyremaps Keytool keyup +Kfiles KILLFOCUS killrunner Knownfolders +kotlin KSPROPERTY Kybd LAlt Lambson langword +lastcodeanalysissucceeded Lastdevice Laute laviusmotileng @@ -880,6 +1024,7 @@ LError Lessthan LEVELID LExit +lexon lhs lhwnd LIBID @@ -1000,7 +1145,6 @@ Metadatas metafile mfapi mfc -mfcm mfidl mfobjects mfplat @@ -1064,6 +1208,7 @@ msc msclr mscorlib msdata +msdax msedge MSGFLT MSIFASTINSTALL @@ -1087,6 +1232,7 @@ multizone mvvm myfile MYICON +mysql NAMECHANGE nameof NCACTIVATE @@ -1132,6 +1278,7 @@ nielslaute NIF NLD nlog +nls NLSTEXT NOACTIVATE NOAGGREGATION @@ -1254,6 +1401,7 @@ PARENTRELATIVEPARSING PArgb parray PARTIALCONFIRMATIONDIALOGTITLE +pascaligo pasteplain PATCOPY pathcch @@ -1276,7 +1424,6 @@ pdw PDWORD pedrolamas Pels -Pels PERCEIVEDFLAG perfmon pesi @@ -1286,6 +1433,7 @@ pfn pfo pft pgp +pgsql pguid PHANDLE PHANDLER @@ -1315,10 +1463,12 @@ Pnp Popups POPUPWINDOW posix +postiats poweraccent powerlauncher POWEROCR powerpreview +powerquery powerrename POWERRENAMECONTEXTMENU powerrenameinput @@ -1326,6 +1476,7 @@ POWERRENAMETEST powertoy POWERTOYNAME powertoyssetup +powertoysusersetup Powrprof ppidl ppmt @@ -1428,8 +1579,8 @@ RECTDESTINATION RECTL rectp rects -recyclebin redirectedfrom +redis Redist redistributable reencode @@ -1446,10 +1597,12 @@ REGFILTERPINS REGISTERCLASSFAILED REGISTRYHEADER registrypath +registryroot registrypreview REGISTRYPREVIEWEXT regkey REGPINTYPES +regroot regsvr reinit REINSTALLMODE @@ -1459,6 +1612,7 @@ remappings REMAPSUCCESSFUL REMAPUNSUCCESSFUL Remotable +Removedir Removelnk renamable RENAMEONCOLLISION @@ -1521,12 +1675,11 @@ rungameid RUNLEVEL runsettings runtimeclass -runtimeconfig runtimedepsjsonpath runtimeobject runtimepack runtimes -rus +RUS Rutkas RValue rvm @@ -1593,7 +1746,6 @@ SHGFI Shl shldisp shlobj -Shlw shlwapi shmem shobjidl @@ -1699,6 +1851,7 @@ stdcpplatest STDMETHODCALLTYPE STDMETHODIMP stefan +stefansjfw Stereolithography STGM STGMEDIUM @@ -1749,6 +1902,7 @@ SYSMENU SYSTEMAPPS systemroot SYSTEMTIME +systemverilog sysvol Tadele talynone @@ -1768,6 +1922,7 @@ taskkill tasklist taskschd tchar +tcl Tcollab tcscpy TCustom @@ -1835,6 +1990,7 @@ TYPESHORTCUT UAC UAL uap +uby udit Udk Udp @@ -2092,6 +2248,7 @@ xcopy XDocument XDOWN XElement +xfd XFile XIncrement XLoc @@ -2110,7 +2267,7 @@ yinle yinwang yinyue YOffset -YResolution +ypescript YResolution YStr YUY diff --git a/.gitignore b/.gitignore index 14c1e39737..cbd74e790c 100644 --- a/.gitignore +++ b/.gitignore @@ -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 diff --git a/.pipelines/ESRPSigning_core.json b/.pipelines/ESRPSigning_core.json index 8ebf519c13..117385722e 100644 --- a/.pipelines/ESRPSigning_core.json +++ b/.pipelines/ESRPSigning_core.json @@ -251,6 +251,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", diff --git a/.pipelines/ESRPSigning_installer.json b/.pipelines/ESRPSigning_installer.json index dea4efc7f4..b20e2cdc82 100644 --- a/.pipelines/ESRPSigning_installer.json +++ b/.pipelines/ESRPSigning_installer.json @@ -5,8 +5,8 @@ { "MatchedPath": [ "PowerToysSetupCustomActions.dll", - "PowerToysSetup-*.exe", - "PowerToysSetup-*.msi" + "PowerToys*Setup-*.exe", + "PowerToys*Setup-*.msi" ], "SigningInfo": { "Operations": [ diff --git a/.pipelines/ci/templates/build-powertoys-steps.yml b/.pipelines/ci/templates/build-powertoys-steps.yml index 6ec51b343c..0da849f2bb 100644 --- a/.pipelines/ci/templates/build-powertoys-steps.yml +++ b/.pipelines/ci/templates/build-powertoys-steps.yml @@ -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 @@ -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 @@ -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' diff --git a/.pipelines/installer-steps.yml b/.pipelines/installer-steps.yml new file mode 100644 index 0000000000..6ab7e01009 --- /dev/null +++ b/.pipelines/installer-steps.yml @@ -0,0 +1,141 @@ +parameters: + - name: versionNumber + type: string + default: "0.0.1" + - name: perUserArg + type: string + default: "false" + - name: buildSubDir + type: string + default: "MachineSetup" + - name: installerPrefix + type: string + default: "PowerToysSetup" + +steps: + - task: VSBuild@1 + displayName: Build PowerToysSetupCustomActions DLL # This dll needs to be build and signed before building the MSI. + inputs: + solution: "**/installer/PowerToysSetup.sln" + vsVersion: 17.0 + msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog /t:PowerToysSetupCustomActions /p:RunBuildEvents=true /p:PerUser=${{parameters.perUserArg}} + platform: $(BuildPlatform) + configuration: $(BuildConfiguration) + clean: true + maximumCpuCount: true + + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + displayName: Sign PowerToysSetupCustomActions DLL + inputs: + ConnectedServiceName: "Terminal/Console/WinAppDriver Team Code Signing Connection" + FolderPath: 'installer/PowerToysSetupCustomActions/$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}' + signType: batchSigning + batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' + ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' + + ## INSTALLER START + #### MSI BUILDING AND SIGNING + - task: VSBuild@1 + displayName: Build MSI + inputs: + solution: "**/installer/PowerToysSetup.sln" + vsVersion: 17.0 + msbuildArgs: /p:CIBuild=true /target:PowerToysInstaller /bl:$(Build.SourcesDirectory)\msbuild.binlog /p:RunBuildEvents=false /p:PerUser=${{parameters.perUserArg}} + platform: $(BuildPlatform) + configuration: $(BuildConfiguration) + clean: false # don't undo our hard work above by deleting the CustomActions dll + maximumCpuCount: true + + - task: CmdLine@2 + displayName: "Extracting MSI to verify contents" + inputs: + script: | + "C:\Program Files (x86)\WiX Toolset v3.14\bin\dark.exe" -x $(build.sourcesdirectory)\extractedMsi installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}\${{parameters.installerPrefix}}-${{ parameters.versionNumber }}-$(BuildPlatform).msi + dir $(build.sourcesdirectory)\extractedMsi + + # Did we sign all files + - task: PowerShell@1 + displayName: Verifying entire build is signed and version set + inputs: + scriptName: .pipelines/versionAndSignCheck.ps1 + arguments: -targetDir '$(build.sourcesdirectory)\extractedMsi\File' + + - task: PowerShell@1 + displayName: Verifying MSI Custom Actions DLL is signed + inputs: + scriptName: .pipelines/versionAndSignCheck.ps1 + arguments: -targetDir '$(build.sourcesdirectory)\extractedMsi\Binary' + + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + displayName: Sign MSI + inputs: + ConnectedServiceName: "Terminal/Console/WinAppDriver Team Code Signing Connection" + FolderPath: 'installer/PowerToysSetup/$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}' + signType: batchSigning + batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' + ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' + #### END MSI + #### BOOTSTRAP BUILDING AND SIGNING + + - task: VSBuild@1 + displayName: Build Bootstrapper + inputs: + solution: "**/installer/PowerToysSetup.sln" + vsVersion: 17.0 + msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog /t:PowerToysBootstrapper /p:PerUser=${{parameters.perUserArg}} + platform: $(BuildPlatform) + configuration: $(BuildConfiguration) + clean: false # don't undo our hard work above by deleting the MSI + maximumCpuCount: true + + - task: CmdLine@2 + displayName: "Insignia: Extract Engine from Bundle" + inputs: + script: '"C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ib installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}\${{parameters.installerPrefix}}-${{ parameters.versionNumber }}-$(BuildPlatform).exe -o installer\engine.exe' + + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + displayName: "ESRP CodeSigning (Engine)" + inputs: + ConnectedServiceName: "Terminal/Console/WinAppDriver Team Code Signing Connection" + FolderPath: "installer" + Pattern: engine.exe + signConfigType: inlineSignParams + inlineOperation: | + [ + { + "KeyCode": "CP-230012", + "OperationCode": "SigntoolSign", + "Parameters": { + "OpusName": "Microsoft", + "OpusInfo": "http://www.microsoft.com", + "FileDigest": "/fd \"SHA256\"", + "PageHash": "/NPH", + "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" + }, + "ToolName": "sign", + "ToolVersion": "1.0" + }, + { + "KeyCode": "CP-230012", + "OperationCode": "SigntoolVerify", + "Parameters": {}, + "ToolName": "sign", + "ToolVersion": "1.0" + } + ] + + - task: CmdLine@2 + displayName: "Insignia: Merge Engine into Bundle" + inputs: + script: '"C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ab installer\engine.exe installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}\${{parameters.installerPrefix}}-${{ parameters.versionNumber }}-$(BuildPlatform).exe -o installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}\${{parameters.installerPrefix}}-${{ parameters.versionNumber }}-$(BuildPlatform).exe' + + - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 + displayName: Sign Bootstrapper + inputs: + ConnectedServiceName: "Terminal/Console/WinAppDriver Team Code Signing Connection" + FolderPath: 'installer/PowerToysSetup/$(BuildPlatform)\$(BuildConfiguration)\${{parameters.buildSubDir}}' + signType: batchSigning + batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' + ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' + #### END BOOTSTRAP + ## END INSTALLER diff --git a/.pipelines/release.yml b/.pipelines/release.yml index 81da06f416..e2ff24492b 100644 --- a/.pipelines/release.yml +++ b/.pipelines/release.yml @@ -175,17 +175,6 @@ jobs: clean: true maximumCpuCount: true - - task: VSBuild@1 - displayName: Build PowerToysSetupCustomActions - inputs: - solution: '**/installer/PowerToysSetup.sln' - vsVersion: 17.0 - msbuildArgs: /target:PowerToysSetupCustomActions /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog - platform: $(BuildPlatform) - configuration: $(BuildConfiguration) - clean: true - maximumCpuCount: true - - task: VSBuild@1 displayName: Publish Settings for Packaging inputs: @@ -313,29 +302,10 @@ jobs: configuration: $(BuildConfiguration) maximumCpuCount: true - - task: VSBuild@1 - displayName: Build PowerToysSetupCustomActions DLL # This dll needs to be build and signed before building the MSI. - inputs: - solution: '**/installer/PowerToysSetup.sln' - vsVersion: 17.0 - msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog /t:PowerToysSetupCustomActions /p:RunBuildEvents=true - platform: $(BuildPlatform) - configuration: $(BuildConfiguration) - maximumCpuCount: true - #### MAIN SIGNING AREA # reference https://dev.azure.com/microsoft/Dart/_git/AppDriver?path=/ESRPSigning.json&version=GBarm64-netcore&_a=contents for winappdriver # https://dev.azure.com/microsoft/Dart/_git/AppDriver?path=/CIPolicy.xml&version=GBarm64-netcore&_a=contents - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 - displayName: Sign PowerToysSetupCustomActions DLL - inputs: - ConnectedServiceName: 'Terminal/Console/WinAppDriver Team Code Signing Connection' - FolderPath: 'installer/PowerToysSetupCustomActions/$(BuildPlatform)\$(BuildConfiguration)' - signType: batchSigning - batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' - ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 displayName: Sign Core PT inputs: @@ -356,114 +326,6 @@ jobs: #### END SIGNING ## END MAIN -## INSTALLER START -#### MSI BUILDING AND SIGNING - - task: VSBuild@1 - displayName: Build MSI - inputs: - solution: '**/installer/PowerToysSetup.sln' - vsVersion: 17.0 - msbuildArgs: /p:CIBuild=true /target:PowerToysInstaller /bl:$(Build.SourcesDirectory)\msbuild.binlog /p:RunBuildEvents=false - platform: $(BuildPlatform) - configuration: $(BuildConfiguration) - clean: false # don't undo our hard work above by deleting the CustomActions dll - maximumCpuCount: true - - - task: CmdLine@2 - displayName: 'Extracting MSI to verify contents' - inputs: - script: | - "C:\Program Files (x86)\WiX Toolset v3.14\bin\dark.exe" -x $(build.sourcesdirectory)\extractedMsi installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).msi - dir $(build.sourcesdirectory)\extractedMsi - -# Did we sign all files - - task: PowerShell@1 - displayName: Verifying entire build is signed and version set - inputs: - scriptName: .pipelines/versionAndSignCheck.ps1 - arguments: -targetDir '$(build.sourcesdirectory)\extractedMsi\File' - - - task: PowerShell@1 - displayName: Verifying MSI Custom Actions DLL is signed - inputs: - scriptName: .pipelines/versionAndSignCheck.ps1 - arguments: -targetDir '$(build.sourcesdirectory)\extractedMsi\Binary' - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 - displayName: Sign MSI - inputs: - ConnectedServiceName: 'Terminal/Console/WinAppDriver Team Code Signing Connection' - FolderPath: 'installer/PowerToysSetup/$(BuildPlatform)\$(BuildConfiguration)' - signType: batchSigning - batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' - ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' -#### END MSI - -#### BOOTSTRAP BUILDING AND SIGNING - - task: VSBuild@1 - displayName: Build Bootstrapper - inputs: - solution: '**/installer/PowerToysSetup.sln' - vsVersion: 17.0 - msbuildArgs: /p:CIBuild=true /bl:$(Build.SourcesDirectory)\msbuild.binlog /t:PowerToysBootstrapper - platform: $(BuildPlatform) - configuration: $(BuildConfiguration) - clean: false # don't undo our hard work above by deleting the MSI - maximumCpuCount: true - - - task: CmdLine@2 - displayName: 'Insignia: Extract Engine from Bundle' - inputs: - script: '"C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ib installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).exe -o installer\engine.exe' - - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 - displayName: 'ESRP CodeSigning (Engine)' - inputs: - ConnectedServiceName: 'Terminal/Console/WinAppDriver Team Code Signing Connection' - FolderPath: 'installer' - Pattern: engine.exe - signConfigType: inlineSignParams - inlineOperation: | - [ - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolSign", - "Parameters": { - "OpusName": "Microsoft", - "OpusInfo": "http://www.microsoft.com", - "FileDigest": "/fd \"SHA256\"", - "PageHash": "/NPH", - "TimeStamp": "/tr \"http://rfc3161.gtm.corp.microsoft.com/TSS/HttpTspServer\" /td sha256" - }, - "ToolName": "sign", - "ToolVersion": "1.0" - }, - { - "KeyCode": "CP-230012", - "OperationCode": "SigntoolVerify", - "Parameters": {}, - "ToolName": "sign", - "ToolVersion": "1.0" - } - ] - - - task: CmdLine@2 - displayName: 'Insignia: Merge Engine into Bundle' - inputs: - script: '"C:\Program Files (x86)\WiX Toolset v3.14\bin\insignia.exe" -ab installer\engine.exe installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).exe -o installer\PowerToysSetup\$(BuildPlatform)\$(BuildConfiguration)\PowerToysSetup-${{ parameters.versionNumber }}-$(BuildPlatform).exe' - - - task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1 - displayName: Sign Bootstrapper - inputs: - ConnectedServiceName: 'Terminal/Console/WinAppDriver Team Code Signing Connection' - FolderPath: 'installer/PowerToysSetup/$(BuildPlatform)\$(BuildConfiguration)' - signType: batchSigning - batchSignPolicyFile: '$(build.sourcesdirectory)\.pipelines\ESRPSigning_installer.json' - ciPolicyFile: '$(build.sourcesdirectory)\.pipelines\CIPolicy.xml' -#### END BOOTSTRAP -## END INSTALLER - - task: PublishBuildArtifacts@1 displayName: 'Publish Artifact: binlog' condition: failed() @@ -514,13 +376,6 @@ jobs: SourceFolder: $(Build.ArtifactStagingDirectory)/Symbols-$(BuildPlatform)/ RemoveSourceFolder: True - - task: CopyFiles@2 - displayName: Copying setup file over - inputs: - contents: '**/PowerToysSetup-*.exe' - flattenFolders: True - targetFolder: $(Build.ArtifactStagingDirectory) - - task: PowerShell@2 displayName: 'Calculating SHA256 hash' inputs: @@ -539,9 +394,45 @@ jobs: $hash | out-file -filepath $combinedPath pwsh: true - + + - template: installer-steps.yml + parameters: + versionNumber: ${{ parameters.versionNumber }} + perUserArg: "false" + buildSubDir: "MachineSetup" + installerPrefix: "PowerToysSetup" + + - 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: NuGet restore solutions dependencies + inputs: + command: restore + restoreSolution: 'installer/*.sln' + selectOrConfig: config + nugetConfigPath: .pipelines/release-nuget.config + + - template: installer-steps.yml + parameters: + versionNumber: ${{ parameters.versionNumber }} + perUserArg: "true" + buildSubDir: "UserSetup" + installerPrefix: "PowerToysUserSetup" + + - task: CopyFiles@2 + displayName: Copying setup file over + inputs: + contents: "**/PowerToys*Setup-*.exe" + flattenFolders: True + targetFolder: $(Build.ArtifactStagingDirectory) + - task: PublishBuildArtifacts@1 - displayName: 'Publish Artifact: PowerToySetup' + displayName: "Publish Artifact: PowerToySetup" inputs: PathtoPublish: $(System.ArtifactsDirectory) ArtifactName: setup-$(BuildPlatform) diff --git a/.pipelines/versionAndSignCheck.ps1 b/.pipelines/versionAndSignCheck.ps1 index b0089f17fa..c39d7eac84 100644 --- a/.pipelines/versionAndSignCheck.ps1 +++ b/.pipelines/versionAndSignCheck.ps1 @@ -79,4 +79,4 @@ if ($totalFailure -gt 0) { exit 1 } -exit 0 +exit 0 \ No newline at end of file diff --git a/installer/PowerToysSetup/AlwaysOnTop.wxs b/installer/PowerToysSetup/AlwaysOnTop.wxs index 3ffc1b7f36..f98f84d987 100644 --- a/installer/PowerToysSetup/AlwaysOnTop.wxs +++ b/installer/PowerToysSetup/AlwaysOnTop.wxs @@ -4,21 +4,22 @@ - - - - - - - - - + + + + + + - - - + + + + + + + diff --git a/installer/PowerToysSetup/Awake.wxs b/installer/PowerToysSetup/Awake.wxs index 645cb61cf5..7228069434 100644 --- a/installer/PowerToysSetup/Awake.wxs +++ b/installer/PowerToysSetup/Awake.wxs @@ -4,29 +4,31 @@ - + + + + - - - - - - - + + - - - + + - - - + + + + + + + + diff --git a/installer/PowerToysSetup/ColorPicker.wxs b/installer/PowerToysSetup/ColorPicker.wxs index 85beb55268..088c94e19e 100644 --- a/installer/PowerToysSetup/ColorPicker.wxs +++ b/installer/PowerToysSetup/ColorPicker.wxs @@ -4,33 +4,31 @@ - + + + + - - - - - - - - + + + - - - - - - - + + + - - - - + + + + + + + + diff --git a/installer/PowerToysSetup/Common.wxi b/installer/PowerToysSetup/Common.wxi index c0956226fc..76dcb2ac9d 100644 --- a/installer/PowerToysSetup/Common.wxi +++ b/installer/PowerToysSetup/Common.wxi @@ -19,11 +19,38 @@ - - + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/installer/PowerToysSetup/Core.wxs b/installer/PowerToysSetup/Core.wxs index 549da15b0f..330ff1cd76 100644 --- a/installer/PowerToysSetup/Core.wxs +++ b/installer/PowerToysSetup/Core.wxs @@ -6,15 +6,20 @@ - + - + + + + + + - + @@ -22,7 +27,7 @@ - + @@ -33,20 +38,35 @@ - - + + + + + - - + + + + + - - + + + + + - - + + + + + - - + + + + + @@ -70,33 +90,26 @@ - - - - - - + + + + + + + + + - - - - - - - - - - - - - - - - + + + + + + @@ -121,22 +134,30 @@ - + + + + + + + + + + + + - - - - + diff --git a/installer/PowerToysSetup/FancyZones.wxs b/installer/PowerToysSetup/FancyZones.wxs index 555c46057c..1a29f8df40 100644 --- a/installer/PowerToysSetup/FancyZones.wxs +++ b/installer/PowerToysSetup/FancyZones.wxs @@ -4,22 +4,22 @@ - + + - - - - - - + + - - - - + + + + + + + diff --git a/installer/PowerToysSetup/FileExplorerPreview.wxs b/installer/PowerToysSetup/FileExplorerPreview.wxs index 88f8e97d2b..ba819ad22c 100644 --- a/installer/PowerToysSetup/FileExplorerPreview.wxs +++ b/installer/PowerToysSetup/FileExplorerPreview.wxs @@ -4,32 +4,31 @@ - - - - - + + + + - - - - - - + + + - - - + + + + + + + + + + + + + - - - - - - - diff --git a/installer/PowerToysSetup/FileLocksmith.wxs b/installer/PowerToysSetup/FileLocksmith.wxs index 9c3d2848ca..d0d49c3bb5 100644 --- a/installer/PowerToysSetup/FileLocksmith.wxs +++ b/installer/PowerToysSetup/FileLocksmith.wxs @@ -4,70 +4,46 @@ - - + + + + - - - - - - - + + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/Hosts.wxs b/installer/PowerToysSetup/Hosts.wxs index 217251e054..5a63b632f3 100644 --- a/installer/PowerToysSetup/Hosts.wxs +++ b/installer/PowerToysSetup/Hosts.wxs @@ -4,67 +4,42 @@ - - + + + + - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + diff --git a/installer/PowerToysSetup/ImageResizer.wxs b/installer/PowerToysSetup/ImageResizer.wxs index 22e6b44d94..5534e838c8 100644 --- a/installer/PowerToysSetup/ImageResizer.wxs +++ b/installer/PowerToysSetup/ImageResizer.wxs @@ -4,98 +4,96 @@ - - + + + + - - - - - - - + + + - + - + - - - - - - - - - - - - - + + + + + + + + + + + + + + - - - - - - - + + + - - - - - + + + + + + + + diff --git a/installer/PowerToysSetup/KeyboardManager.wxs b/installer/PowerToysSetup/KeyboardManager.wxs index 1bb67443b2..925588c41e 100644 --- a/installer/PowerToysSetup/KeyboardManager.wxs +++ b/installer/PowerToysSetup/KeyboardManager.wxs @@ -7,26 +7,43 @@ - + + + + - + + + + - + + + + - + + + + + + + + + diff --git a/installer/PowerToysSetup/MeasureTool.wxs b/installer/PowerToysSetup/MeasureTool.wxs index 38ed627afe..879a3246ac 100644 --- a/installer/PowerToysSetup/MeasureTool.wxs +++ b/installer/PowerToysSetup/MeasureTool.wxs @@ -4,42 +4,35 @@ - - + + - - - - - - - - - - - + + - - - - - + + + + + + - - - - - - - - - + + + + + + + + + + diff --git a/installer/PowerToysSetup/MonacoSRC.wxs b/installer/PowerToysSetup/MonacoSRC.wxs new file mode 100644 index 0000000000..b8a997ac44 --- /dev/null +++ b/installer/PowerToysSetup/MonacoSRC.wxs @@ -0,0 +1,1059 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/installer/PowerToysSetup/MouseUtils.wxs b/installer/PowerToysSetup/MouseUtils.wxs index 44260d14b4..933b6b115f 100644 --- a/installer/PowerToysSetup/MouseUtils.wxs +++ b/installer/PowerToysSetup/MouseUtils.wxs @@ -4,40 +4,31 @@ - + + + + + - - - - - - - - - - - - - - + + + - - - - - - + + + + - - - - - - - - + + + + + + + + diff --git a/installer/PowerToysSetup/PastePlain.wxs b/installer/PowerToysSetup/PastePlain.wxs index cca601a1ca..a0a92e4603 100644 --- a/installer/PowerToysSetup/PastePlain.wxs +++ b/installer/PowerToysSetup/PastePlain.wxs @@ -7,12 +7,21 @@ - - + + + + + - + + + + + + + diff --git a/installer/PowerToysSetup/PowerAccent.wxs b/installer/PowerToysSetup/PowerAccent.wxs index 928a3ca488..98d78ca856 100644 --- a/installer/PowerToysSetup/PowerAccent.wxs +++ b/installer/PowerToysSetup/PowerAccent.wxs @@ -4,22 +4,22 @@ - + + - - - - - - + + - - - - + + + + + + + diff --git a/installer/PowerToysSetup/PowerRename.wxs b/installer/PowerToysSetup/PowerRename.wxs index 56de970b29..5b5f48f1e7 100644 --- a/installer/PowerToysSetup/PowerRename.wxs +++ b/installer/PowerToysSetup/PowerRename.wxs @@ -4,31 +4,27 @@ - - - + + + + - - - - - - - - + + + - + - + - + @@ -36,38 +32,31 @@ - - - - - - - - - - - - - - - - - - + + + + + - + + + + + + + + + + + + + + + - - - - - - - - - + diff --git a/installer/PowerToysSetup/PowerToys.wxs b/installer/PowerToysSetup/PowerToys.wxs index 0818170273..848efb8133 100644 --- a/installer/PowerToysSetup/PowerToys.wxs +++ b/installer/PowerToysSetup/PowerToys.wxs @@ -1,25 +1,13 @@ - - - - - - - - - - - - - - - + + + - + + + + + - + + + + - TargetPowerToysVersion >= DetectedPowerToysVersion OR WixBundleInstalled + + + + MinimumVersion >= DetectedPowerToysVersion + TargetPowerToysVersion >= DetectedPowerToysUserVersion OR WixBundleInstalled + + TargetPowerToysVersion >= DetectedPowerToysVersion OR WixBundleInstalled + @@ -61,7 +63,7 @@ Id="TerminatePowerToys" SourceFile="terminate_powertoys.cmd" Permanent="yes" - PerMachine="yes" + PerMachine="$(var.PerMachineYesNo)" Vital="no"> diff --git a/installer/PowerToysSetup/PowerToysBootstrapper.wixproj b/installer/PowerToysSetup/PowerToysBootstrapper.wixproj index f03cc88b35..ca71607595 100644 --- a/installer/PowerToysSetup/PowerToysBootstrapper.wixproj +++ b/installer/PowerToysSetup/PowerToysBootstrapper.wixproj @@ -1,4 +1,4 @@ - + PowerToysBootstrapper {31d72625-43c1-41b1-b784-bce4a8dc5543} + + $(DefineConstants);PerUser=true + + + $(DefineConstants);PerUser=false + Release x64 @@ -20,8 +26,10 @@ PowerToysSetup-$(Version)-$(Platform) Bundle True - PowerToysSetup-$(Version)-$(Platform) - $(Platform)\$(Configuration)\ + PowerToysSetup-$(Version)-$(Platform) + PowerToysUserSetup-$(Version)-$(Platform) + $(Platform)\$(Configuration)\MachineSetup + $(Platform)\$(Configuration)\UserSetup obj\$(Platform)\$(Configuration)\ diff --git a/installer/PowerToysSetup/PowerToysInstaller.wixproj b/installer/PowerToysSetup/PowerToysInstaller.wixproj index 131d2dceda..3e8a693449 100644 --- a/installer/PowerToysSetup/PowerToysInstaller.wixproj +++ b/installer/PowerToysSetup/PowerToysInstaller.wixproj @@ -1,4 +1,4 @@ - + @@ -11,8 +11,8 @@ simulate the build pipeline doing that for you. --> IF NOT DEFINED IsPipeline ( call "$([MSBuild]::GetVsInstallRoot())\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.19041.0 -SET PTRoot=..\..\..\.. -call "..\..\publish.cmd" x64 +SET PTRoot=..\..\..\..\.. +call "..\..\..\publish.cmd" x64 ) @@ -20,20 +20,50 @@ call "..\..\publish.cmd" x64 Version=$(Version);MonacoSRCHarvestPath=$(ProjectDir)..\..\ARM64\$(Configuration)\modules\FileExplorerPreview\monacoSRC IF NOT DEFINED IsPipeline ( call "$([MSBuild]::GetVsInstallRoot())\Common7\Tools\VsDevCmd.bat" -arch=arm64 -host_arch=amd64 -winsdk=10.0.19041.0 -SET PTRoot=..\..\..\.. -call "..\..\publish.cmd" arm64 +SET PTRoot=..\..\..\..\.. +call "..\..\..\publish.cmd" arm64 ) Always - call move /Y ..\..\Core.wxs.bk ..\..\Core.wxs - call move /Y ..\..\..\PowerToysSetupCustomActions\DepsFilesLists.h.bk ..\..\..\PowerToysSetupCustomActions\DepsFilesLists.h + call move /Y ..\..\..\AlwaysOnTop.wxs.bk ..\..\..\AlwaysOnTop.wxs + call move /Y ..\..\..\Awake.wxs.bk ..\..\..\Awake.wxs + call move /Y ..\..\..\ColorPicker.wxs.bk ..\..\..\ColorPicker.wxs + call move /Y ..\..\..\Core.wxs.bk ..\..\..\Core.wxs + call move /Y ..\..\..\FancyZones.wxs.bk ..\..\..\FancyZones.wxs + call move /Y ..\..\..\FileExplorerPreview.wxs.bk ..\..\..\FileExplorerPreview.wxs + call move /Y ..\..\..\FileLocksmith.wxs.bk ..\..\..\FileLocksmith.wxs + call move /Y ..\..\..\Hosts.wxs.bk ..\..\..\Hosts.wxs + call move /Y ..\..\..\ImageResizer.wxs.bk ..\..\..\ImageResizer.wxs + call move /Y ..\..\..\KeyboardManager.wxs.bk ..\..\..\KeyboardManager.wxs + call move /Y ..\..\..\MeasureTool.wxs.bk ..\..\..\MeasureTool.wxs + call move /Y ..\..\..\MouseUtils.wxs.bk ..\..\..\MouseUtils.wxs + 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 + call move /Y ..\..\..\ShortcutGuide.wxs.bk ..\..\..\ShortcutGuide.wxs + call move /Y ..\..\..\TextExtractor.wxs.bk ..\..\..\TextExtractor.wxs + call move /Y ..\..\..\Tools.wxs.bk ..\..\..\Tools.wxs + call move /Y ..\..\..\VideoConference.wxs.bk ..\..\..\VideoConference.wxs + call move /Y ..\..\..\WinAppSDK.wxs.bk ..\..\..\WinAppSDK.wxs + call move /Y ..\..\..\..\PowerToysSetupCustomActions\DepsFilesLists.h.bk ..\..\..\..\PowerToysSetupCustomActions\DepsFilesLists.h PowerToysInstaller + + $(DefineConstants);PerUser=true + + + $(DefineConstants);PerUser=false + + Release @@ -41,15 +71,22 @@ call "..\..\publish.cmd" arm64 3.10 022a9d30-7c4f-416d-a9df-5ff2661cc0ad 2.0 - PowerToysSetup-$(Version)-$(Platform) + PowerToysSetup-$(Version)-$(Platform) + PowerToysUserSetup-$(Version)-$(Platform) Package True + + + ICE91 + 1026;1076 - $(Platform)\$(Configuration)\ - obj\$(Platform)\$(Configuration)\ + $(Platform)\$(Configuration)\MachineSetup + $(Platform)\$(Configuration)\UserSetup + obj\$(Platform)\$(Configuration)\MachineSetup + obj\$(Platform)\$(Configuration)\UserSetup ICE40 @@ -139,18 +176,19 @@ call "..\..\publish.cmd" arm64 - --> - + SuppressFragments="false" + SuppressRegistry="false" + SuppressRootDirectory="true"/> + --> + \ No newline at end of file diff --git a/installer/PowerToysSetup/Product.wxs b/installer/PowerToysSetup/Product.wxs index 88c47e351a..6569f77162 100644 --- a/installer/PowerToysSetup/Product.wxs +++ b/installer/PowerToysSetup/Product.wxs @@ -23,16 +23,17 @@ Language="1033" Version="$(var.Version)" Manufacturer="Microsoft Corporation" - UpgradeCode="42B84BF7-5FBF-473B-9C8B-049DC16F7708"> + UpgradeCode="$(var.UpgradeCodeGUID)"> - + + - + @@ -51,7 +52,7 @@ + Description="Contains all PowerToys features."> @@ -118,13 +119,13 @@ - - + + - + ""]]> @@ -132,6 +133,7 @@ DEFAULTBOOTSTRAPPERINSTALLFOLDER OR PREVIOUSINSTALLFOLDER = ""]]> + @@ -424,7 +426,7 @@ - + @@ -513,79 +515,62 @@ - - - - - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/RegistryPreview.wxs b/installer/PowerToysSetup/RegistryPreview.wxs index b8200848ee..7beeb08f4f 100644 --- a/installer/PowerToysSetup/RegistryPreview.wxs +++ b/installer/PowerToysSetup/RegistryPreview.wxs @@ -4,49 +4,32 @@ - - - - + + - + + - - - - - - + + + - - - - - - - - - - - - - + + + - - - - - - - - - - - + + + + + + + + diff --git a/installer/PowerToysSetup/Resources.wxs b/installer/PowerToysSetup/Resources.wxs index f164df96ca..351bd05393 100644 --- a/installer/PowerToysSetup/Resources.wxs +++ b/installer/PowerToysSetup/Resources.wxs @@ -145,48 +145,72 @@ Id="Launcher_$(var.IdSafeLanguage)_Component" Directory="Resource$(var.IdSafeLanguage)LauncherInstallFolder" Guid="$(var.CompGUIDPrefix)00"> + + + + + + + + + + + + + + + + + + + + + + + + @@ -194,119 +218,257 @@ Id="Launcher_Calculator_$(var.IdSafeLanguage)_Component" Directory="Resource$(var.IdSafeLanguage)CalculatorPluginFolder" Guid="$(var.CompGUIDPrefix)08"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/installer/PowerToysSetup/Run.wxs b/installer/PowerToysSetup/Run.wxs index 669f8b469c..9d22b64156 100644 --- a/installer/PowerToysSetup/Run.wxs +++ b/installer/PowerToysSetup/Run.wxs @@ -4,294 +4,359 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/installer/PowerToysSetup/Settings.wxs b/installer/PowerToysSetup/Settings.wxs index 0686ccfab6..698575cbcf 100644 --- a/installer/PowerToysSetup/Settings.wxs +++ b/installer/PowerToysSetup/Settings.wxs @@ -4,116 +4,71 @@ - - - - - + + - - + + + + + + + + + + + - - - - - - - - - - - - - - + + + - - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - + + + + - - - - - - + + + + - - - - - - + + + + + - - - - - + + + + + + - - - - - - - - - - - - - diff --git a/installer/PowerToysSetup/ShortcutGuide.wxs b/installer/PowerToysSetup/ShortcutGuide.wxs index 9f425289db..2053ffae34 100644 --- a/installer/PowerToysSetup/ShortcutGuide.wxs +++ b/installer/PowerToysSetup/ShortcutGuide.wxs @@ -4,37 +4,48 @@ + + + - - - - - - - - + + + + - - + + + + + - - + + + + + - - - - + + + + + + + + + + diff --git a/installer/PowerToysSetup/TextExtractor.wxs b/installer/PowerToysSetup/TextExtractor.wxs index f4f4c725b0..3afbb2a5e1 100644 --- a/installer/PowerToysSetup/TextExtractor.wxs +++ b/installer/PowerToysSetup/TextExtractor.wxs @@ -4,22 +4,22 @@ - + + - - - - - - - + + - - + + + + + + + - diff --git a/installer/PowerToysSetup/Tools.wxs b/installer/PowerToysSetup/Tools.wxs index 23aea33d13..a9fe0bf306 100644 --- a/installer/PowerToysSetup/Tools.wxs +++ b/installer/PowerToysSetup/Tools.wxs @@ -6,18 +6,33 @@ - - + + + + + - + + + + - + + + + - + + + + + + + diff --git a/installer/PowerToysSetup/VideoConference.wxs b/installer/PowerToysSetup/VideoConference.wxs index 231ed04f8f..c2b6915e5c 100644 --- a/installer/PowerToysSetup/VideoConference.wxs +++ b/installer/PowerToysSetup/VideoConference.wxs @@ -7,22 +7,28 @@ - + WINDOWSBUILDNUMBER >= 19041 + + + - + - + - + WINDOWSBUILDNUMBER >= 19041 + + + @@ -38,7 +44,14 @@ - + + + + + + + + diff --git a/installer/PowerToysSetup/WinAppSDK.wxs b/installer/PowerToysSetup/WinAppSDK.wxs index 998a28dfbf..cb20c8cfa9 100644 --- a/installer/PowerToysSetup/WinAppSDK.wxs +++ b/installer/PowerToysSetup/WinAppSDK.wxs @@ -5,17 +5,15 @@ + - - - - - + + @@ -320,6 +318,9 @@ Id="SettingsV2_WinAppSDKLoc_$(var.IdSafeLanguage)_Component" Directory="WinAppSDKLoc$(var.IdSafeLanguage)SettingsV2InstallFolder" Guid="$(var.CompGUIDPrefix)01"> + + + @@ -327,6 +328,9 @@ Id="PowerRename_WinAppSDKLoc_$(var.IdSafeLanguage)_Component" Directory="WinAppSDKLoc$(var.IdSafeLanguage)PowerRenameInstallFolder" Guid="$(var.CompGUIDPrefix)02"> + + + @@ -334,6 +338,9 @@ Id="MeasureTool_WinAppSDKLoc_$(var.IdSafeLanguage)_Component" Directory="WinAppSDKLoc$(var.IdSafeLanguage)MeasureToolInstallFolder" Guid="$(var.CompGUIDPrefix)03"> + + + @@ -341,30 +348,166 @@ Id="Hosts_WinAppSDKLoc_$(var.IdSafeLanguage)_Component" Directory="WinAppSDKLoc$(var.IdSafeLanguage)HostsInstallFolder" Guid="$(var.CompGUIDPrefix)04"> - - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - diff --git a/installer/PowerToysSetup/generateAllFileComponents.ps1 b/installer/PowerToysSetup/generateAllFileComponents.ps1 new file mode 100644 index 0000000000..93b35f7684 --- /dev/null +++ b/installer/PowerToysSetup/generateAllFileComponents.ps1 @@ -0,0 +1,214 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory = $True, Position = 1)] + [string]$platform, + [Parameter(Mandatory = $False, Position = 2)] + [string]$installscopeperuser = "false" +) + +if ($platform -ceq "arm64") { + $platform = "ARM64" +} + +if ($installscopeperuser -eq "true") { + $registryroot = "HKCU" +} else { + $registryroot = "HKLM" +} + +#AlwaysOnTop +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName AlwaysOnTopFiles -wxsFilePath $PSScriptRoot\AlwaysOnTop.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\AlwaysOnTop""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""AlwaysOnTopFiles"" -wxsFilePath $PSScriptRoot\AlwaysOnTop.wxs -regroot $registryroot" + +#AwakeFiles +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\Awake\PowerToys.Awake.deps.json"" -fileListName AwakeFiles -wxsFilePath $PSScriptRoot\Awake.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName AwakeImagesFiles -wxsFilePath $PSScriptRoot\Awake.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\Awake\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""AwakeFiles"" -wxsFilePath $PSScriptRoot\Awake.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""AwakeImagesFiles"" -wxsFilePath $PSScriptRoot\Awake.wxs -regroot $registryroot" + +#ColorPicker +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\ColorPicker\PowerToys.ColorPickerUI.deps.json"" -fileListName ColorPickerFiles -wxsFilePath $PSScriptRoot\ColorPicker.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName ColorPickerResourcesFiles -wxsFilePath $PSScriptRoot\ColorPicker.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\ColorPicker\Resources""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ColorPickerFiles"" -wxsFilePath $PSScriptRoot\ColorPicker.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ColorPickerResourcesFiles"" -wxsFilePath $PSScriptRoot\ColorPicker.wxs -regroot $registryroot" + +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\ColorPicker\PowerToys.ColorPickerUI.deps.json"" -fileListName ColorPickerFiles -wxsFilePath $PSScriptRoot\ColorPicker.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ColorPickerFiles"" -wxsFilePath $PSScriptRoot\ColorPicker.wxs -regroot $registryroot" + +#FancyZones +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\FancyZones\PowerToys.FancyZonesEditor.deps.json"" -fileListName FancyZonesFiles -wxsFilePath $PSScriptRoot\FancyZones.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""FancyZonesFiles"" -wxsFilePath $PSScriptRoot\FancyZones.wxs -regroot $registryroot" + +#FileExplorerAdd-ons +#TODO: There are multiple .deps.json files, make sure it works as expected +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\FileExplorerPreview\PowerToys.SvgThumbnailProvider.deps.json"" -fileListName PowerPreviewFiles -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName MonacoCustomLanguagesFiles -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\FileExplorerPreview\customLanguages""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""PowerPreviewFiles"" -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""MonacoCustomLanguagesFiles"" -wxsFilePath $PSScriptRoot\FileExplorerPreview.wxs -regroot $registryroot" + +#FileLocksmith +#TODO: There are multiple .deps.json files, make sure it works as expected +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\FileLocksmith\PowerToys.FileLocksmithUI.deps.json"" -fileListName FileLocksmithFiles -wxsFilePath $PSScriptRoot\FileLocksmith.wxs -isWinAppSdkProj 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName FileLocksmithAssetsFiles -wxsFilePath $PSScriptRoot\FileLocksmith.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\FileLocksmith\Assets\""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""FileLocksmithFiles"" -wxsFilePath $PSScriptRoot\FileLocksmith.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""FileLocksmithAssetsFiles"" -wxsFilePath $PSScriptRoot\FileLocksmith.wxs -regroot $registryroot" + +#Hosts +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\Hosts\PowerToys.Hosts.deps.json"" -fileListName HostsFiles -wxsFilePath $PSScriptRoot\Hosts.wxs -isWinAppSdkProj 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName HostsAssetsFiles -wxsFilePath $PSScriptRoot\Hosts.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\Hosts\Assets\""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""HostsFiles"" -wxsFilePath $PSScriptRoot\Hosts.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""HostsAssetsFiles"" -wxsFilePath $PSScriptRoot\Hosts.wxs -regroot $registryroot" + +#ImageResizer +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\ImageResizer\PowerToys.ImageResizer.deps.json"" -fileListName ImageResizerFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName ImageResizerAssetsFiles -wxsFilePath $PSScriptRoot\ImageResizer.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\ImageResizer\Assets\""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ImageResizerFiles"" -wxsFilePath $PSScriptRoot\ImageResizer.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ImageResizerAssetsFiles"" -wxsFilePath $PSScriptRoot\ImageResizer.wxs -regroot $registryroot" + +#MouseUtils +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName MouseUtilsFiles -wxsFilePath $PSScriptRoot\MouseUtils.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\MouseUtils\""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""MouseUtilsFiles"" -wxsFilePath $PSScriptRoot\MouseUtils.wxs -regroot $registryroot" +#MouseJumpUI +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\MouseUtils\MouseJumpUI\PowerToys.MouseJumpUI.deps.json"" -fileListName MouseJumpUIFiles -wxsFilePath $PSScriptRoot\MouseUtils.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""MouseJumpUIFiles"" -wxsFilePath $PSScriptRoot\MouseUtils.wxs -regroot $registryroot" + +#MeasureTool +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\MeasureTool\PowerToys.MeasureToolUI.deps.json"" -fileListName MeasureToolFiles -wxsFilePath $PSScriptRoot\MeasureTool.wxs -isWinAppSdkProj 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""MeasureToolFiles"" -wxsFilePath $PSScriptRoot\MeasureTool.wxs -regroot $registryroot" + +#PowerAccent +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\PowerAccent\PowerToys.PowerAccent.deps.json"" -fileListName PowerAccentFiles -wxsFilePath $PSScriptRoot\PowerAccent.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""PowerAccentFiles"" -wxsFilePath $PSScriptRoot\PowerAccent.wxs -regroot $registryroot" + +#PowerRename +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName PowerRenameFiles -wxsFilePath $PSScriptRoot\PowerRename.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\PowerRename\"" -isWinAppSdkProj 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName PowerRenameAssetsFiles -wxsFilePath $PSScriptRoot\PowerRename.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\PowerRename\Assets\""" +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""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""launcherFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""launcherImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +## Plugins +###Calculator +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Calculator\Microsoft.PowerToys.Run.Plugin.Calculator.deps.json"" -fileListName calcComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName calcImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Calculator\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""calcComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""calcImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###Folder +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Folder\Microsoft.Plugin.Folder.deps.json"" -fileListName FolderComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName FolderImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Folder\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""FolderComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""FolderImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###Program +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Program\Microsoft.Plugin.Program.deps.json"" -fileListName ProgramComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName ProgramImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Program\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ProgramComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ProgramImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###Shell +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Shell\Microsoft.Plugin.Shell.deps.json"" -fileListName ShellComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName ShellImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Shell\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ShellComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ShellImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###Indexer +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Indexer\Microsoft.Plugin.Indexer.deps.json"" -fileListName IndexerComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName IndexerImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Indexer\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""IndexerComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""IndexerImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###UnitConverter +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\UnitConverter\Community.PowerToys.Run.Plugin.UnitConverter.deps.json"" -fileListName UnitConvCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName UnitConvImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\UnitConverter\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""UnitConvCompFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""UnitConvImagesCompFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###WebSearch +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\WebSearch\Community.PowerToys.Run.Plugin.WebSearch.deps.json"" -fileListName WebSrchCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName WebSrchImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\WebSearch\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""WebSrchCompFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""WebSrchImagesCompFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###History +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\History\Microsoft.PowerToys.Run.Plugin.History.deps.json"" -fileListName HistoryPluginComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName HistoryPluginImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\History\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""HistoryPluginComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""HistoryPluginImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###Uri +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Uri\Microsoft.Plugin.Uri.deps.json"" -fileListName UriComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName UriImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Uri\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""UriComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""UriImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###VSCodeWorkspaces +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\VSCodeWorkspaces\Community.PowerToys.Run.Plugin.VSCodeWorkspaces.deps.json"" -fileListName VSCWrkCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName VSCWrkImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\VSCodeWorkspaces\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""VSCWrkCompFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""VSCWrkImagesCompFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###WindowWalker +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\WindowWalker\Microsoft.Plugin.WindowWalker.deps.json"" -fileListName WindowWlkrCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName WindowWlkrImagesCompFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\WindowWalker\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""WindowWlkrCompFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""WindowWlkrImagesCompFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###OneNote +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\OneNote\Microsoft.PowerToys.Run.Plugin.OneNote.deps.json"" -fileListName OneNoteComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName OneNoteImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\OneNote\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""OneNoteComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""OneNoteImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###Registry +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Registry\Microsoft.PowerToys.Run.Plugin.Registry.deps.json"" -fileListName RegistryComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName RegistryImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Registry\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""RegistryComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""RegistryImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###Service +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Service\Microsoft.PowerToys.Run.Plugin.Service.deps.json"" -fileListName ServiceComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName ServiceImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\Service\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ServiceComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ServiceImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###System +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\System\Microsoft.PowerToys.Run.Plugin.System.deps.json"" -fileListName SystemComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName SystemImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\System\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""SystemComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""SystemImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###TimeDate +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\TimeDate\Microsoft.PowerToys.Run.Plugin.TimeDate.deps.json"" -fileListName TimeDateComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName TimeDateImagesComponentFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\TimeDate\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""TimeDateComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""TimeDateImagesComponentFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###WindowsSettings +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\WindowsSettings\Microsoft.PowerToys.Run.Plugin.WindowsSettings.deps.json"" -fileListName WinSetCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName WinSetImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\WindowsSettings\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""WinSetCmpFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""WinSetImagesCmpFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +###WindowsTerminal +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\WindowsTerminal\Microsoft.PowerToys.Run.Plugin.WindowsTerminal.deps.json"" -fileListName WinTermCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -isLauncherPlugin 1" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName WinTermImagesCmpFiles -wxsFilePath $PSScriptRoot\Run.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\launcher\Plugins\WindowsTerminal\Images""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""WinTermCmpFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""WinTermImagesCmpFiles"" -wxsFilePath $PSScriptRoot\Run.wxs -regroot $registryroot" +## Plugins + +#ShortcutGuide +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName ShortcutGuideSvgFiles -wxsFilePath $PSScriptRoot\ShortcutGuide.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\modules\ShortcutGuide\ShortcutGuide\svgs\""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""ShortcutGuideSvgFiles"" -wxsFilePath $PSScriptRoot\ShortcutGuide.wxs -regroot $registryroot" + +#TextExtractor +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\modules\PowerOCR\PowerToys.PowerOCR.deps.json"" -fileListName TextExtractorFiles -wxsFilePath $PSScriptRoot\TextExtractor.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""TextExtractorFiles"" -wxsFilePath $PSScriptRoot\TextExtractor.wxs -regroot $registryroot" + +#Settings +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson ""$PSScriptRoot..\..\..\$platform\Release\Settings\PowerToys.Settings.deps.json"" -fileListName SettingsV2Files -wxsFilePath $PSScriptRoot\Settings.wxs" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName SettingsV2AssetsFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\Settings\Assets\""" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName SettingsV2AssetsModulesFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\Settings\Assets\Modules\""" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName SettingsV2OOBEAssetsModulesFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\Settings\Assets\Modules\OOBE\""" +Invoke-Expression -Command "$PSScriptRoot\generateFileList.ps1 -fileDepsJson """" -fileListName SettingsV2OOBEAssetsFluentIconsFiles -wxsFilePath $PSScriptRoot\Settings.wxs -depsPath ""$PSScriptRoot..\..\..\$platform\Release\Settings\Assets\FluentIcons\""" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""SettingsV2Files"" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""SettingsV2AssetsFiles"" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""SettingsV2AssetsModulesFiles"" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""SettingsV2OOBEAssetsModulesFiles"" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot" +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""SettingsV2OOBEAssetsFluentIconsFiles"" -wxsFilePath $PSScriptRoot\Settings.wxs -regroot $registryroot" + +#WinAppSdk +Invoke-Expression -Command "$PSScriptRoot\generateFileComponents.ps1 -fileListName ""WinAppSDKFiles"" -wxsFilePath $PSScriptRoot\WinAppSDK.wxs -regroot $registryroot" diff --git a/installer/PowerToysSetup/generateFileComponents.ps1 b/installer/PowerToysSetup/generateFileComponents.ps1 new file mode 100644 index 0000000000..ad223711e8 --- /dev/null +++ b/installer/PowerToysSetup/generateFileComponents.ps1 @@ -0,0 +1,56 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory = $True, Position = 1)] + [string]$fileListName, + [Parameter(Mandatory = $True, Position = 2)] + [string]$wxsFilePath, + [Parameter(Mandatory = $True, Position = 3)] + [string]$regroot +) + +$wxsFile = Get-Content $wxsFilePath; + +$wxsFile | ForEach-Object { + if ($_ -match "(") { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'fileList', + Justification = 'variable is used in another scope')] + + $fileList = $matches[2] -split ';' + return + } +} + +$componentId = "$($fileListName)_Component" + +$componentDefs = "`r`n" +$componentDefs += +@" + + + + `r`n +"@ + +foreach ($file in $fileList) { + $fileTmp = $file -replace "-", "_" + $componentDefs += +@" + `r`n +"@ +} + +$componentDefs += +@" + `r`n +"@ + +$wxsFile = $wxsFile -replace "\s+()", $componentDefs + +$componentRef = +@" + +"@ + +$wxsFile = $wxsFile -replace "\s+()", "$componentRef`r`n " + +Set-Content -Path $wxsFilePath -Value $wxsFile \ No newline at end of file diff --git a/installer/PowerToysSetup/generateFileList.ps1 b/installer/PowerToysSetup/generateFileList.ps1 new file mode 100644 index 0000000000..5925ebedb2 --- /dev/null +++ b/installer/PowerToysSetup/generateFileList.ps1 @@ -0,0 +1,84 @@ +[CmdletBinding()] +Param( + [Parameter(Mandatory = $True, Position = 1)] + [AllowEmptyString()] + [string]$fileDepsJson, + [Parameter(Mandatory = $True, Position = 2)] + [string]$fileListName, + [Parameter(Mandatory = $True, Position = 3)] + [string]$wxsFilePath, + # If there is no deps.json file, just pass path to files + [Parameter(Mandatory = $False, Position = 4)] + [string]$depsPath, + # launcher plugins are being loaded into launcher process, + # so there are some additional dependencies to skip + [Parameter(Mandatory = $False, Position = 5)] + [bool]$isLauncherPlugin, + # Skip winAppSDK dlls as those are hard-linked + [Parameter(Mandatory = $False, Position = 6)] + [bool]$isWinAppSdkProj +) + +$fileWxs = Get-Content $wxsFilePath; + +#Skip PowerToysInterop files +$coreWxs = Get-Content $PSScriptRoot/"Core.wxs" +$coreWxs | ForEach-Object { + if ($_ -match "(") { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'fileList', + Justification = 'variable is used in another scope')] + + $interopFilesList = $matches[2] -split ';' + return + } +} + +#Skip WinAppSdk files +if ($isWinAppSdkProj -eq $True) { + $winAppSDKWxs = Get-Content $PSScriptRoot/"WinAppSDK.wxs" + $winAppSDKWxs | ForEach-Object { + if ($_ -match "(") { + [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseDeclaredVarsMoreThanAssignments', 'fileList', + Justification = 'variable is used in another scope')] + + $winAppSDKfilesList = $matches[2] -split ';' + return + } + } +} + +$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") + +$dllsToIgnore = @("System.CodeDom.dll", "WindowsBase.dll") + +if ($fileDepsJson -eq [string]::Empty) { + $fileDepsRoot = $depsPath +} else { + $fileDepsRoot = (Get-ChildItem $fileDepsJson).Directory.FullName + $depsJson = Get-Content $fileDepsJson | ConvertFrom-Json + + $runtimeList = ([array]$depsJson.targets.PSObject.Properties)[-1].Value.PSObject.Properties | Where-Object { + $_.Name -match "runtimepack.*Runtime" + }; + + $runtimeList | ForEach-Object { + $_.Value.PSObject.Properties.Value | ForEach-Object { + $fileExclusionList += $_.PSObject.Properties.Name + } + } +} + +$fileExclusionList = $fileExclusionList | Where-Object {$_ -notin $dllsToIgnore} + +if ($isLauncherPlugin -eq $True) { + $fileInclusionList += @("*.deps.json") + $fileExclusionList += @("Ijwhost.dll", "PowerToys.Common.UI.dll", "PowerToys.GPOWrapper.dll", "PowerToys.GPOWrapperProjection.dll", "PowerToys.PowerLauncher.Telemetry.dll", "PowerToys.ManagedCommon.dll", "PowerToys.Settings.UI.Lib.dll", "Wox.Infrastructure.dll", "Wox.Plugin.dll") +} + +$fileList = Get-ChildItem $fileDepsRoot -Include $fileInclusionList -Exclude $fileExclusionList -File -Name + +$fileWxs = $fileWxs -replace "(<\?define $($fileListName)=)", "data()); } diff --git a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj index 1e5e6c2295..f7370d499d 100644 --- a/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj +++ b/installer/PowerToysSetupCustomActions/PowerToysSetupCustomActions.vcxproj @@ -1,4 +1,4 @@ - + @@ -33,8 +33,10 @@ - $(Platform)\$(Configuration)\ - $(SolutionDir)$(ProjectName)\$(Platform)\$(Configuration)\obj\ + $(Platform)\$(Configuration)\MachineSetup + $(Platform)\$(Configuration)\UserSetup + $(SolutionDir)$(ProjectName)\$(Platform)\$(Configuration)\MachineSetup\obj\ + $(SolutionDir)$(ProjectName)\$(Platform)\$(Configuration)\UserSetup\obj\ true @@ -47,8 +49,33 @@ call cmd /C "copy ""$(ProjectDir)DepsFilesLists.h"" ""$(ProjectDir)DepsFilesLists.h.bk""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\AlwaysOnTop.wxs"" ""$(ProjectDir)..\PowerToysSetup\AlwaysOnTop.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Awake.wxs"" ""$(ProjectDir)..\PowerToysSetup\Awake.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\ColorPicker.wxs"" ""$(ProjectDir)..\PowerToysSetup\ColorPicker.wxs.bk"""" call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Core.wxs"" ""$(ProjectDir)..\PowerToysSetup\Core.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\FancyZones.wxs"" ""$(ProjectDir)..\PowerToysSetup\FancyZones.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\FileExplorerPreview.wxs"" ""$(ProjectDir)..\PowerToysSetup\FileExplorerPreview.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\FileLocksmith.wxs"" ""$(ProjectDir)..\PowerToysSetup\FileLocksmith.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Hosts.wxs"" ""$(ProjectDir)..\PowerToysSetup\Hosts.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\ImageResizer.wxs"" ""$(ProjectDir)..\PowerToysSetup\ImageResizer.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\KeyboardManager.wxs"" ""$(ProjectDir)..\PowerToysSetup\KeyboardManager.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\MeasureTool.wxs"" ""$(ProjectDir)..\PowerToysSetup\MeasureTool.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\MouseUtils.wxs"" ""$(ProjectDir)..\PowerToysSetup\MouseUtils.wxs.bk"""" + 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"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\ShortcutGuide.wxs"" ""$(ProjectDir)..\PowerToysSetup\ShortcutGuide.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\TextExtractor.wxs"" ""$(ProjectDir)..\PowerToysSetup\TextExtractor.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\Tools.wxs"" ""$(ProjectDir)..\PowerToysSetup\Tools.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\VideoConference.wxs"" ""$(ProjectDir)..\PowerToysSetup\VideoConference.wxs.bk"""" + call cmd /C "copy ""$(ProjectDir)..\PowerToysSetup\WinAppSDK.wxs"" ""$(ProjectDir)..\PowerToysSetup\WinAppSDK.wxs.bk"""" call powershell.exe -NonInteractive -executionpolicy Unrestricted -File parseRuntimes.ps1 -runtimedepsjsonpath "$(ProjectDir)..\..\$(Platform)\$(Configuration)\Settings\PowerToys.Settings.deps.json" -wpfdepsjsonpath "$(ProjectDir)..\..\$(Platform)\$(Configuration)\modules\ColorPicker\PowerToys.ColorPickerUI.deps.json" -depsfileslistspath "$(ProjectDir)DepsFilesLists.h" -productwxspath "$(ProjectDir)..\PowerToysSetup\Core.wxs" + if not "$(PerUser)" == "true" call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetup\generateAllFileComponents.ps1 -platform $(Platform) + if "$(PerUser)" == "true" call powershell.exe -NonInteractive -executionpolicy Unrestricted -File ..\PowerToysSetup\generateAllFileComponents.ps1 -platform $(Platform) -installscopeperuser $(PerUser) Backing up original files and populating .NET and WPF Runtime dependencies diff --git a/src/common/updating/updating.cpp b/src/common/updating/updating.cpp index 3bb560319a..c0e194403b 100644 --- a/src/common/updating/updating.cpp +++ b/src/common/updating/updating.cpp @@ -8,6 +8,9 @@ #include #include +#include + +using namespace registry::install_scope; namespace // Strings in this namespace should not be localized { @@ -42,9 +45,16 @@ namespace updating std::pair extract_installer_asset_download_info(const json::JsonObject& release_object) { const std::wstring_view required_architecture = get_architecture_string(get_current_architecture()); - constexpr const std::wstring_view required_filename_pattern = updating::INSTALLER_FILENAME_PATTERN; + std::wstring_view required_filename_pattern = updating::INSTALLER_FILENAME_PATTERN; // Desc-sorted by its priority const std::array asset_extensions = { L".exe", L".msi" }; + + const InstallScope current_install_scope = get_current_install_scope(); + if (current_install_scope == InstallScope::PerUser) + { + required_filename_pattern = updating::INSTALLER_FILENAME_PATTERN_USER; + } + for (const auto asset_extension : asset_extensions) { for (auto asset_elem : release_object.GetNamedArray(L"assets")) diff --git a/src/common/updating/updating.h b/src/common/updating/updating.h index a5a15e47de..11ab3b95fd 100644 --- a/src/common/updating/updating.h +++ b/src/common/updating/updating.h @@ -31,4 +31,5 @@ namespace updating // non-localized constexpr inline std::wstring_view INSTALLER_FILENAME_PATTERN = L"powertoyssetup"; + constexpr inline std::wstring_view INSTALLER_FILENAME_PATTERN_USER = L"powertoysusersetup"; } diff --git a/src/common/updating/updating.vcxproj b/src/common/updating/updating.vcxproj index b68206c358..04625c09cf 100644 --- a/src/common/updating/updating.vcxproj +++ b/src/common/updating/updating.vcxproj @@ -15,6 +15,7 @@ v143 + diff --git a/src/common/utils/MsiUtils.h b/src/common/utils/MsiUtils.h index 1489685005..f369dd3b6f 100644 --- a/src/common/utils/MsiUtils.h +++ b/src/common/utils/MsiUtils.h @@ -12,14 +12,16 @@ namespace // Strings in this namespace should not be localized { const inline wchar_t POWER_TOYS_UPGRADE_CODE[] = L"{42B84BF7-5FBF-473B-9C8B-049DC16F7708}"; + const inline wchar_t POWER_TOYS_UPGRADE_CODE_USER[] = L"{D8B559DB-4C98-487A-A33F-50A8EEE42726}"; const inline wchar_t POWERTOYS_EXE_COMPONENT[] = L"{A2C66D91-3485-4D00-B04D-91844E6B345B}"; } -std::optional GetMsiPackageInstalledPath() +std::optional GetMsiPackageInstalledPath(bool perUser) { constexpr size_t guid_length = 39; wchar_t product_ID[guid_length]; - if (const bool found = ERROR_SUCCESS == MsiEnumRelatedProductsW(POWER_TOYS_UPGRADE_CODE, 0, 0, product_ID); !found) + std::wstring upgradeCode = (perUser ? POWER_TOYS_UPGRADE_CODE_USER : POWER_TOYS_UPGRADE_CODE); + if (const bool found = ERROR_SUCCESS == MsiEnumRelatedProductsW(upgradeCode.c_str(), 0, 0, product_ID); !found) { return std::nullopt; } diff --git a/src/common/utils/registry.h b/src/common/utils/registry.h index cd4a3fb715..57507e36b1 100644 --- a/src/common/utils/registry.h +++ b/src/common/utils/registry.h @@ -16,6 +16,83 @@ namespace registry { + namespace install_scope + { + const wchar_t INSTALL_SCOPE_REG_KEY[] = L"Software\\Classes\\powertoys\\"; + + enum class InstallScope + { + PerMachine = 0, + PerUser, + }; + + inline const InstallScope get_current_install_scope() + { + // Open HKLM key + HKEY perMachineKey{}; + if (RegOpenKeyExW(HKEY_LOCAL_MACHINE, + INSTALL_SCOPE_REG_KEY, + 0, + KEY_READ, + &perMachineKey) != ERROR_SUCCESS) + { + // Open HKCU key + HKEY perUserKey{}; + if (RegOpenKeyExW(HKEY_CURRENT_USER, + INSTALL_SCOPE_REG_KEY, + 0, + KEY_READ, + &perUserKey) != ERROR_SUCCESS) + { + // both keys are missing + return InstallScope::PerMachine; + } + else + { + DWORD dataSize{}; + if (RegGetValueW( + perUserKey, + nullptr, + L"InstallScope", + RRF_RT_REG_SZ, + nullptr, + nullptr, + &dataSize) != ERROR_SUCCESS) + { + // HKCU key is missing + RegCloseKey(perUserKey); + return InstallScope::PerMachine; + } + + std::wstring data; + data.resize(dataSize / sizeof(wchar_t)); + + if (RegGetValueW( + perUserKey, + nullptr, + L"InstallScope", + RRF_RT_REG_SZ, + nullptr, + &data[0], + &dataSize) != ERROR_SUCCESS) + { + // HKCU key is missing + RegCloseKey(perUserKey); + return InstallScope::PerMachine; + } + RegCloseKey(perUserKey); + + if (data.contains(L"perUser")) + { + return InstallScope::PerUser; + } + } + } + + return InstallScope::PerMachine; + } + } + template inline constexpr bool always_false_v = false;