From d7859f03db827f3cfbd903c994ab9d6445c0fdee Mon Sep 17 00:00:00 2001 From: Sasha Pierson Date: Wed, 9 Oct 2019 12:21:21 -0700 Subject: [PATCH] Dev/sashapie/wix nuget sacl (#489) * point to csproj instead * version * rs1 container * nuget * nuget and msbuild * vs2019 * msbuild path * new container, clear up feeds * change step names, verify build output * further dig into outputs * point to right output, add draft installer script * narrow down output, change signing option * new container, try installer * set vs dev environment * add NuGet package for WiX * modify project files to use the WiX NuGet package the MSI can now be built using MSBUILD after running nuget restore * ready installer sln to use nuget * install and build scripts and new container * src/editor was renamed to src/settings, fix rebase error * check if file is present * try again --- .pipelines/build-installer.cmd | 4 ++ .pipelines/build.cmd | 4 +- .pipelines/pipeline.user.windows.yml | 57 +++++++++++++------ .pipelines/restore-installer.cmd | 3 + .pipelines/restore-telemetry.cmd | 6 ++ .pipelines/restore.cmd | 2 +- .../PowerToysSetup/PowerToysSetup.wixproj | 19 +++++-- installer/PowerToysSetup/Product.wxs | 8 +-- installer/PowerToysSetup/packages.config | 4 ++ .../PowerToysSetupCustomActions.vcxproj | 24 ++++---- ...owerToysSetupCustomActions.vcxproj.filters | 1 + .../packages.config | 4 ++ 12 files changed, 96 insertions(+), 40 deletions(-) create mode 100644 .pipelines/build-installer.cmd create mode 100644 .pipelines/restore-installer.cmd create mode 100644 .pipelines/restore-telemetry.cmd create mode 100644 installer/PowerToysSetup/packages.config create mode 100644 installer/PowerToysSetupCustomActions/packages.config diff --git a/.pipelines/build-installer.cmd b/.pipelines/build-installer.cmd new file mode 100644 index 0000000000..6d821a57db --- /dev/null +++ b/.pipelines/build-installer.cmd @@ -0,0 +1,4 @@ +cd /D "%~dp0" + +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.16299.0 +call msbuild ../installer/PowerToysSetup.sln /p:Configuration=Release /p:Platform=x64 || exit /b 1 diff --git a/.pipelines/build.cmd b/.pipelines/build.cmd index 632efb6e8d..bf91228a92 100644 --- a/.pipelines/build.cmd +++ b/.pipelines/build.cmd @@ -1,2 +1,4 @@ cd /D "%~dp0" -dotnet build --no-restore ..\PowerToys.sln || exit /b 1 + +call "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\Tools\VsDevCmd.bat" -arch=amd64 -host_arch=amd64 -winsdk=10.0.16299.0 +call msbuild ../PowerToys.sln /p:Configuration=Release /p:Platform=x64 || exit /b 1 diff --git a/.pipelines/pipeline.user.windows.yml b/.pipelines/pipeline.user.windows.yml index d6c8a24359..f0377afe9f 100644 --- a/.pipelines/pipeline.user.windows.yml +++ b/.pipelines/pipeline.user.windows.yml @@ -5,39 +5,60 @@ environment: version: '2016' runtime: provider: 'appcontainer' - image: 'cdpxwinrs4test.azurecr.io/global/vse2017u7-external-azsdk-mobile-ext-win1803:latest-nodetools' - source_mode: 'link' + image: 'cdpxwin.azurecr.io/user/powertoys/vs2019:3.0' + source_mode: 'map' + +version: + name: 'PowerToys' + major: 1 + minor: 0 signing_options: - profile: 'azure' + profile: 'external_distribution' package_sources: nuget: feeds: - 'Toolset': 'https://msazure.pkgs.visualstudio.com/_packaging/Toolset/nuget/v3/index.json' - 'CloudES-CDP': 'https://cloudes.pkgs.visualstudio.com/_packaging/CDP/nuget/v3/index.json' - 'CloudES-Internal': 'https://cloudes.pkgs.visualstudio.com/_packaging/Internal/nuget/v3/index.json' - 'MsNugetMirror': 'https://msazure.pkgs.visualstudio.com/_packaging/MsNugetMirror/nuget/v3/index.json' - 'NugetMirror': 'https://msazure.pkgs.visualstudio.com/_packaging/NugetMirror/nuget/v3/index.json' - 'CorextMirror': 'https://msazure.pkgs.visualstudio.com/_packaging/CorextMirror/nuget/v3/index.json' - 'Official': 'https://msazure.pkgs.visualstudio.com/_packaging/Official/nuget/v3/index.json' - 'Toolset': 'https://msazure.pkgs.visualstudio.com/_packaging/Toolset/nuget/v3/index.json' - 'AzureCXP': 'https://msazure.pkgs.visualstudio.com/_packaging/AzureCXP/nuget/v3/index.json' + 'Nuget': 'https://api.nuget.org/v3/index.json' + 'PipelineBuildSupplement': 'https://msazure.pkgs.visualstudio.com/_packaging/PipelineBuildSupplement/nuget/v3/index.json' restore: commands: - !!defaultcommand - name: 'Restore CSharp' + name: 'Restore Power Toys Telemetry' + command: '.pipelines\restore-telemetry.cmd' + - !!defaultcommand + name: 'Restore Power Toys' command: '.pipelines\restore.cmd' - + - !!defaultcommand + name: 'Restore Installer' + command: '.pipelines\restore-installer.cmd' + + build: commands: - !!buildcommand - name: 'Build CSharp' + name: 'Build Power Toys' command: '.pipelines\build.cmd' artifacts: - - from: '**\bin' + - from: 'x64/Release' to: 'Build_Output' include: - - '**/*' - + - 'PowerToys.exe' + - 'PowerToysSettings.exe' + - 'modules\FancyZonesEditor.exe' + - 'modules\fancyzones.dll' + - 'modules\shortcut_guide.dll' + signing_options: + sign_inline: true # This does signing a soon as this command completes + - !!buildcommand + name: 'Build Power Toys Installer' + command: '.pipelines\build-installer.cmd' + artifacts: + - from: 'installer\PowerToysSetup\x64\Release' + to: 'Build_Installer_Output' + include: + - 'PowerToysSetup.msi' + signing_options: + sign_inline: true # This does signing a soon as this command completes + \ No newline at end of file diff --git a/.pipelines/restore-installer.cmd b/.pipelines/restore-installer.cmd new file mode 100644 index 0000000000..7eb9d6d32b --- /dev/null +++ b/.pipelines/restore-installer.cmd @@ -0,0 +1,3 @@ +cd /D "%~dp0" + +nuget restore ../installer/PowerToysSetup.sln || exit /b 1 diff --git a/.pipelines/restore-telemetry.cmd b/.pipelines/restore-telemetry.cmd new file mode 100644 index 0000000000..d56351d4e3 --- /dev/null +++ b/.pipelines/restore-telemetry.cmd @@ -0,0 +1,6 @@ +cd /D "%~dp0" + +set PROJECT="..\src\modules\fancyzones\editor\FancyZonesEditor\FancyZonesEditor.csproj" +set TELEMETRY_PKG="Microsoft.PowerToys.Telemetry" + +dotnet add %PROJECT% package %TELEMETRY_PKG% diff --git a/.pipelines/restore.cmd b/.pipelines/restore.cmd index 3a9d719a4e..fd630aea59 100644 --- a/.pipelines/restore.cmd +++ b/.pipelines/restore.cmd @@ -1,3 +1,3 @@ cd /D "%~dp0" -dotnet restore ..\PowerToys.sln || exit /b 1 +nuget restore ../PowerToys.sln || exit /b 1 diff --git a/installer/PowerToysSetup/PowerToysSetup.wixproj b/installer/PowerToysSetup/PowerToysSetup.wixproj index 484e051119..79ba3ab6a5 100644 --- a/installer/PowerToysSetup/PowerToysSetup.wixproj +++ b/installer/PowerToysSetup/PowerToysSetup.wixproj @@ -1,5 +1,6 @@ - + + Release x64 @@ -8,6 +9,9 @@ 2.0 PowerToysSetup Package + True + + Debug @@ -47,10 +51,15 @@ INSTALLFOLDER - - - - + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + +