From 66c183bd634cd839a54c8891d03b8de0eb0311af Mon Sep 17 00:00:00 2001 From: stankovski Date: Fri, 18 Sep 2015 08:33:52 -0700 Subject: [PATCH 01/12] Updated PS version check to 5.0 --- setup-powershellget/azurecmd.wxs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/setup-powershellget/azurecmd.wxs b/setup-powershellget/azurecmd.wxs index 4d7330c7bbde..707b3dd31995 100644 --- a/setup-powershellget/azurecmd.wxs +++ b/setup-powershellget/azurecmd.wxs @@ -31,10 +31,10 @@ - - + + - < "3.0")]]> + < "5.0")]]> From 91d7bbadeeb9764a60ae61b4e1752ec7a74a9c47 Mon Sep 17 00:00:00 2001 From: stankovski Date: Fri, 18 Sep 2015 09:05:07 -0700 Subject: [PATCH 02/12] Added ShortcutStartup.ps1 to setup folder and custom action set-executionpolicy to installer --- setup-powershellget/Setup/ShortcutStartup.ps1 | 38 +++++++++++++++++++ setup-powershellget/azurecmd.wxs | 12 +++++- 2 files changed, 48 insertions(+), 2 deletions(-) create mode 100644 setup-powershellget/Setup/ShortcutStartup.ps1 diff --git a/setup-powershellget/Setup/ShortcutStartup.ps1 b/setup-powershellget/Setup/ShortcutStartup.ps1 new file mode 100644 index 000000000000..54b434483269 --- /dev/null +++ b/setup-powershellget/Setup/ShortcutStartup.ps1 @@ -0,0 +1,38 @@ +# ---------------------------------------------------------------------------------- +# +# Copyright Microsoft Corporation +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ---------------------------------------------------------------------------------- + +function Get-ScriptDirectory +{ + $Invocation = (Get-Variable MyInvocation -Scope 1).Value + Split-Path $Invocation.MyCommand.Path +} + +$modulePath = Join-Path $(Split-Path (Get-ScriptDirectory)) "Azure.psd1" +Import-Module $modulePath +cd c:\ +$welcomeMessage = @" +For a list of all Azure cmdlets type 'help azure'. +For a list of Windows Azure Pack cmdlets type 'Get-Command *wapack*'. +For Node.js cmdlets type 'help node-dev'. +For PHP cmdlets type 'help php-dev'. +"@ +Write-Output $welcomeMessage + +Set-ExecutionPolicy -Scope Process Undefined -Force +if ($(Get-ExecutionPolicy) -eq "Restricted") +{ + Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force +} + +$VerbosePreference="Continue" \ No newline at end of file diff --git a/setup-powershellget/azurecmd.wxs b/setup-powershellget/azurecmd.wxs index 707b3dd31995..3fa06c2ea0e3 100644 --- a/setup-powershellget/azurecmd.wxs +++ b/setup-powershellget/azurecmd.wxs @@ -27,6 +27,8 @@ + + @@ -71,15 +73,18 @@ + + + - + + Arguments="-NoExit -ExecutionPolicy Bypass -File "[PowerShellFolder]\ShortcutStartup.ps1""/> @@ -89,16 +94,19 @@ + + NOT Installed NOT Installed + NOT Installed From 7434b64c436e55fdca8ea39f3eab45e67c8d995e Mon Sep 17 00:00:00 2001 From: stankovski Date: Fri, 18 Sep 2015 11:13:02 -0700 Subject: [PATCH 03/12] Added BuildPackagesTask project and synced build with other repos Updated powershellget.wixproj MSI name --- .gitignore | 3 +- build.proj | 240 +++++++++--------- setup-powershellget/powershellget.wixproj | 2 +- .../FilterOutAutoRestLibraries.cs | 73 ++++++ .../Microsoft.Azure.Build.Tasks.csproj | 59 +++++ .../Microsoft.Azure.Build.Tasks.sln | 22 ++ .../Properties/AssemblyInfo.cs | 33 +++ .../BuildPackagesTask/RegexReplacementTask.cs | 86 +++++++ tools/BuildPackagesTask/StrongNameUtility.cs | 84 ++++++ .../ValidateStrongNameSignatureTask.cs | 147 +++++++++++ 10 files changed, 632 insertions(+), 117 deletions(-) create mode 100644 tools/BuildPackagesTask/FilterOutAutoRestLibraries.cs create mode 100644 tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks.csproj create mode 100644 tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks.sln create mode 100644 tools/BuildPackagesTask/Properties/AssemblyInfo.cs create mode 100644 tools/BuildPackagesTask/RegexReplacementTask.cs create mode 100644 tools/BuildPackagesTask/StrongNameUtility.cs create mode 100644 tools/BuildPackagesTask/ValidateStrongNameSignatureTask.cs diff --git a/.gitignore b/.gitignore index d487996de989..d469a9bfdad7 100644 --- a/.gitignore +++ b/.gitignore @@ -193,4 +193,5 @@ UpgradeLog*.htm # Microsoft Fakes FakesAssemblies/ -.vs/ \ No newline at end of file +.vs/ +/tools/*.dll diff --git a/build.proj b/build.proj index a427049579f6..30e351ff9480 100644 --- a/build.proj +++ b/build.proj @@ -1,22 +1,40 @@ - + + + - .\src\ServiceManagement\Services\Commands\bin - .\src\ServiceManagement\Services\Commands.Test\bin - Microsoft.WindowsAzure.Commands.Test.dll - .\setup\build - .\src\Publish - .\src\Package + $(MSBuildThisFileDirectory) + $(LibraryRoot)src + $(LibraryRoot)tools + $(LibrarySourceFolder)\Publish + $(LibrarySourceFolder)\Package + Debug + false + + false $(PublishDirectory)\Build $(PublishDirectory)\Setup $(PublishDirectory)\TestResults - Configuration=Debug;Platform=Any CPU - Configuration=Release;Platform=Any CPU true @@ -37,27 +55,22 @@ - @@ -95,7 +108,7 @@ Force nuget package restore so that packages that include .targets files don't need to be checked into source control. --> - + @@ -123,128 +136,125 @@ - + - + Properties="Configuration=$(Configuration);Platform=Any CPU" + BuildInParallel="$(BuildInParallel)" ContinueOnError="false" /> - - - - - - - + Properties="Configuration=$(Configuration);Platform=Any CPU" + BuildInParallel="$(BuildInParallel)" ContinueOnError="false" /> + + + + + + - - - - - - + + + + + + + + - - - - - - - - + DependsOnTargets="Clean;Build;Test" /> + + + + + + + + + + + 31bf3856ad364e35 + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + false AcceptanceType=CheckIn + - + @@ -252,14 +262,14 @@ + DependsOnTargets="Clean;Build;Test;RunOneSDKCIT" /> + DependsOnTargets="Clean;Build;LiveTestsFilter" /> - + diff --git a/setup-powershellget/powershellget.wixproj b/setup-powershellget/powershellget.wixproj index e8bbbb03674c..c3a89824ad39 100644 --- a/setup-powershellget/powershellget.wixproj +++ b/setup-powershellget/powershellget.wixproj @@ -6,7 +6,7 @@ 3.5 {36d6e303-e057-4963-a093-c7aae0fd92b3} 2.0 - AzurePowerShell + AzurePowerShellGet Package $(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.targets $(MSBuildExtensionsPath)\Microsoft\WiX\v3.x\Wix.targets diff --git a/tools/BuildPackagesTask/FilterOutAutoRestLibraries.cs b/tools/BuildPackagesTask/FilterOutAutoRestLibraries.cs new file mode 100644 index 000000000000..a7a9371db121 --- /dev/null +++ b/tools/BuildPackagesTask/FilterOutAutoRestLibraries.cs @@ -0,0 +1,73 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System.Collections.Generic; +using System.IO; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Microsoft.WindowsAzure.Build.Tasks +{ + public class FilterOutAutoRestLibraries : Task + { + [Required] + public ITaskItem[] AllLibraries { get; set; } + + [Required] + public string AutoRestMark { get; set; } + + [Output] + public ITaskItem[] AutoRestLibraries { get; private set; } + + [Output] + public ITaskItem[] NonAutoRestLibraries { get; private set; } + + public override bool Execute() + { + var autoRestOnes = new List(); + var others = new List(); + foreach (ITaskItem solution in AllLibraries) + { + bool isAutoRestLibrary = false; + string solutionFile = solution.GetMetadata("FullPath"); + string libFolder = Path.GetDirectoryName(solutionFile); + string[] projects = Directory.GetFiles(libFolder, "*.csproj", SearchOption.AllDirectories); + foreach (string project in projects) + { + string text = File.ReadAllText(project); + if (text.Contains(AutoRestMark)) + { + isAutoRestLibrary = true; + break; + } + } + if (isAutoRestLibrary) + { + autoRestOnes.Add(solution); + } + else + { + others.Add(solution); + } + } + + Log.LogMessage(MessageImportance.High, "We have found {0} autorest libraries.", autoRestOnes.Count); + Log.LogMessage(MessageImportance.High, "we have found {0} Non autorest libraries.", others.Count); + AutoRestLibraries = autoRestOnes.ToArray(); + NonAutoRestLibraries = others.ToArray(); + return true; + } + } +} diff --git a/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks.csproj b/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks.csproj new file mode 100644 index 000000000000..48c5c29ec35d --- /dev/null +++ b/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks.csproj @@ -0,0 +1,59 @@ + + + + + Debug + AnyCPU + {16D89061-2C1E-4E31-B16E-8A7B5B9FF51C} + Library + Properties + Microsoft.Azure.Build.Tasks + Microsoft.Azure.Build.Tasks + v4.5 + 512 + + + true + full + false + ..\ + DEBUG;TRACE + prompt + 4 + false + + + pdbonly + true + ..\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks.sln b/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks.sln new file mode 100644 index 000000000000..3060e97842c3 --- /dev/null +++ b/tools/BuildPackagesTask/Microsoft.Azure.Build.Tasks.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30501.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Azure.Build.Tasks", "Microsoft.Azure.Build.Tasks.csproj", "{16D89061-2C1E-4E31-B16E-8A7B5B9FF51C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {16D89061-2C1E-4E31-B16E-8A7B5B9FF51C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {16D89061-2C1E-4E31-B16E-8A7B5B9FF51C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {16D89061-2C1E-4E31-B16E-8A7B5B9FF51C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {16D89061-2C1E-4E31-B16E-8A7B5B9FF51C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/tools/BuildPackagesTask/Properties/AssemblyInfo.cs b/tools/BuildPackagesTask/Properties/AssemblyInfo.cs new file mode 100644 index 000000000000..c05eeeb998a1 --- /dev/null +++ b/tools/BuildPackagesTask/Properties/AssemblyInfo.cs @@ -0,0 +1,33 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Microsoft.WindowsAzure.Build.Tasks")] +[assembly: AssemblyDescription("Build Tasks")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("Microsoft.WindowsAzure.Build.Tasks")] +[assembly: AssemblyCopyright("Copyright © Microsoft Corporation")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] +[assembly: Guid("1fab019b-78ba-4e1b-8f84-d5b72d785f0e")] + +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/tools/BuildPackagesTask/RegexReplacementTask.cs b/tools/BuildPackagesTask/RegexReplacementTask.cs new file mode 100644 index 000000000000..6ecc14cf0d2c --- /dev/null +++ b/tools/BuildPackagesTask/RegexReplacementTask.cs @@ -0,0 +1,86 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; +using System; +using System.IO; +using System.Linq; +using System.Text; +using System.Text.RegularExpressions; + +namespace Microsoft.WindowsAzure.Build.Tasks +{ + public class RegexReplacementTask : Task + { + [Required] + public ITaskItem[] Files { get; set; } + + [Required] + public string Find { get; set; } + + [Required] + public string Replace { get; set; } + + public bool LogReplacement { get; set; } + + /// + /// Gets or sets the optional output directory. If a OutputDir value is + /// specified, the original file contents will not be overwritten. + /// + public string OutputDir { get; set; } + + public override bool Execute() + { + try + { + foreach (string fileName in Files.Select(f => f.GetMetadata("FullPath"))) + { + FileAttributes oldAttributes = File.GetAttributes(fileName); + File.SetAttributes(fileName, oldAttributes & ~FileAttributes.ReadOnly); + + string content = Regex.Replace( + File.ReadAllText(fileName), + Find, + Replace); + + string outputFileName = fileName; + string message = null; + if (!string.IsNullOrEmpty(OutputDir)) + { + string path = Path.GetFullPath(OutputDir); + outputFileName = Path.Combine(path, Path.GetFileName(fileName)); + message = " saved as " + outputFileName; + } + + File.WriteAllText(outputFileName, content, Encoding.UTF8); + File.SetAttributes(outputFileName, oldAttributes); + + if (LogReplacement) + { + Log.LogMessage("Processed regular expression replacement in file {0}{1}", fileName, message); + } + } + + return true; + } + catch (Exception ex) + { + Log.LogErrorFromException(ex); + return false; + } + } + } +} diff --git a/tools/BuildPackagesTask/StrongNameUtility.cs b/tools/BuildPackagesTask/StrongNameUtility.cs new file mode 100644 index 000000000000..e21d78401bdd --- /dev/null +++ b/tools/BuildPackagesTask/StrongNameUtility.cs @@ -0,0 +1,84 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +using System.Diagnostics; +using System.IO; +using System.Linq; + +namespace Microsoft.WindowsAzure.Build.Tasks +{ + /// + /// Utility class for managing the Process used to work with the sn.exe + /// tool in the Windows SDK. + /// + internal class StrongNameUtility + { + private string _snPath; + + public StrongNameUtility() + { + } + + public bool ValidateStrongNameToolExistance(string windowsSdkPath) + { + // Location the .NET strong name signing utility + _snPath = FindFile(windowsSdkPath, "sn.exe"); + if (_snPath == null) + { + return false; + } + + return true; + } + + public bool Execute(string arguments, out string output) + { + int exitCode; + output = null; + + ProcessStartInfo processInfo = new ProcessStartInfo(_snPath) + { + Arguments = arguments, + UseShellExecute = false, + RedirectStandardOutput = true, + }; + + using (Process process = Process.Start(processInfo)) + { + output = process.StandardOutput.ReadToEnd(); + process.WaitForExit(); + + exitCode = process.ExitCode; + } + + return exitCode == 0; + } + + private static string FindFile(string path, string filenameOfInterest) + { + foreach (string d in Directory.GetDirectories(path)) + { + var result = Directory.GetFiles(d, filenameOfInterest).FirstOrDefault(); + if (result != null) + { + return result; + } + + return FindFile(d, filenameOfInterest); + } + + return null; + } + } +} diff --git a/tools/BuildPackagesTask/ValidateStrongNameSignatureTask.cs b/tools/BuildPackagesTask/ValidateStrongNameSignatureTask.cs new file mode 100644 index 000000000000..d75bdc9d9269 --- /dev/null +++ b/tools/BuildPackagesTask/ValidateStrongNameSignatureTask.cs @@ -0,0 +1,147 @@ +// +// Copyright (c) Microsoft. All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; +using Microsoft.Build.Framework; +using Microsoft.Build.Utilities; + +namespace Microsoft.WindowsAzure.Build.Tasks +{ + /// + /// A simple Microsoft Build task for validating the strong name signature + /// on a .NET assembly. + /// + public class ValidateStrongNameSignatureTask : Task + { + /// + /// Gets or sets the path to the Windows SDK on the machine. + /// + [Required] + public string WindowsSdkPath { get; set; } + + /// + /// Gets or sets the assembly whose strong name needs to be verified. + /// + [Required] + public ITaskItem Assembly { get; set; } + + /// + /// Gets or sets the expected strong name token for the assembly. + /// + [Required] + public string ExpectedTokenSignature { get; set; } + + /// + /// Gets or sets a value indicating whether the assembly is expected to + /// be delay signed. + /// + public bool ExpectedDelaySigned { get; set; } + + /// + /// Executes the task to validate the strong name information for the + /// assembly using the input values expected by the task. + /// + /// Returns a value indicating whether the task has been + /// successful and the build should continue. + public override bool Execute() + { + try + { + StrongNameUtility utility = new StrongNameUtility(); + if (!utility.ValidateStrongNameToolExistance(WindowsSdkPath)) + { + Log.LogError("The strong name tool (sn.exe) could not be located within the Windows SDK directory structure ({0})).", WindowsSdkPath); + return false; + } + + string path = Assembly.ItemSpec; + + // Check the public key token of the assembly. + // -q -T: Display token for public key. + string output; + string arguments = "-q -T \"" + path + "\""; + bool success = utility.Execute(arguments, out output); + + if (!success) + { + Log.LogError("The assembly \"" + path + "\" has not been strong named signed."); + Log.LogError(output); + + return false; + } + + // Read the public key token. + int lastSpace = output.LastIndexOf(' '); + if (lastSpace >= 0) + { + output = output.Substring(lastSpace + 1).Trim(); + } + + if (output != ExpectedTokenSignature) + { + Log.LogError("The assembly \"{0}\" had the strong name token of \"{1}\", but was expected to have the token \"{2}\"", + path, + output, + ExpectedTokenSignature); + return false; + } + + Log.LogMessage("The assembly \"{0}\" had the expected strong name token of \"{1}\"", + path, + output); + + // Validate that it is or is not delay signed. + // -q -v[f]: Verify for strong name signature self + // consistency. If -vf is specified, force verification even if + // disabled in the registry. + output = null; + arguments = "-q -vf \"" + path + "\""; + success = utility.Execute(arguments, out output); + + success = (success == (!ExpectedDelaySigned)); + + string message; + if (ExpectedDelaySigned && success || !ExpectedDelaySigned && !success) + { + message = "The assembly \"{0}\" was delay signed."; + } + else if (ExpectedDelaySigned && !success) + { + message = "The assembly \"{0}\" was not delay signed."; + } + else + { + message = "The assembly \"{0}\" has been fully signed."; + } + + if (success) + { + Log.LogMessage(MessageImportance.High, message, path); + } + else + { + Log.LogError(message, path); + } + + return success; + } + catch (Exception ex) + { + Log.LogErrorFromException(ex); + return false; + } + } + } +} From f40ebea34197a9e8ca13c368707a997f9204842a Mon Sep 17 00:00:00 2001 From: stankovski Date: Fri, 18 Sep 2015 12:11:10 -0700 Subject: [PATCH 04/12] Added missing parameters and fixed installer --- build.proj | 75 +++++++++++++++++++++++++++++--- setup-powershellget/azurecmd.wxs | 2 + 2 files changed, 70 insertions(+), 7 deletions(-) diff --git a/build.proj b/build.proj index 30e351ff9480..b95c32e35494 100644 --- a/build.proj +++ b/build.proj @@ -43,6 +43,19 @@ + + + + + $(OnPremiseBuildTasks) + true + false + + + + - + + - + --> + + + - - + + @@ -177,6 +192,21 @@ + + + + + + + + + + + + + - + @@ -244,6 +274,37 @@ + + + + + 31bf3856ad364e35 + + + + + + + + + + + + + + + + + + false diff --git a/setup-powershellget/azurecmd.wxs b/setup-powershellget/azurecmd.wxs index 3fa06c2ea0e3..077be99cd058 100644 --- a/setup-powershellget/azurecmd.wxs +++ b/setup-powershellget/azurecmd.wxs @@ -102,11 +102,13 @@ + NOT Installed NOT Installed NOT Installed + NOT Installed From 6b3f511965226ef258e76968abec1b97c949db16 Mon Sep 17 00:00:00 2001 From: Hovsep Mkrtchyan Date: Fri, 18 Sep 2015 15:43:08 -0700 Subject: [PATCH 05/12] Fixed CLI build check for Microsoft.Bcl.Build. --- .../Commands.Common.Storage/Commands.Common.Storage.csproj | 4 ---- src/Common/Commands.Common.Test/Commands.Common.Test.csproj | 4 ---- src/Common/Commands.Common/Commands.Common.csproj | 4 ---- src/Common/Commands.Profile/Commands.Profile.csproj | 4 ---- .../Commands.ResourceManager.Common.csproj | 4 ---- .../Commands.ResourceManager.Profile.Test.csproj | 4 ---- .../Commands.ResourceManager.Profile.csproj | 4 ---- .../Commands.ScenarioTest/Commands.ScenarioTest.csproj | 4 ---- .../Commands.ScenarioTests.Common.csproj | 4 ---- .../Commands.ScenarioTests.ResourceManager.Common.csproj | 4 ---- .../Commands.ApiManagement.ServiceManagement.csproj | 4 ---- .../Commands.ApiManagement.Test.csproj | 4 ---- .../Commands.ApiManagement/Commands.ApiManagement.csproj | 4 ---- .../Commands.ApiManagement.ServiceManagement.Test.csproj | 4 ---- .../Commands.ResourceManagement.Automation.Test.csproj | 4 ---- .../Commands.ResourceManagement.Automation.csproj | 4 ---- .../Commands.AzureBackup.Test.csproj | 6 +----- .../Commands.AzureBackup/Commands.AzureBackup.csproj | 6 +----- .../Commands.Batch.Test/Commands.Batch.Test.csproj | 6 +----- .../AzureBatch/Commands.Batch/Commands.Batch.csproj | 6 +----- .../Commands.UsageAggregates.csproj | 6 +----- .../Commands.Compute.Test/Commands.Compute.Test.csproj | 4 ---- .../Compute/Commands.Compute/Commands.Compute.csproj | 4 ---- .../Commands.DataFactories.Test.csproj | 4 ---- .../Commands.DataFactories/Commands.DataFactories.csproj | 4 ---- .../Dns/Commands.Dns.Test/Commands.Dns.Test.csproj | 4 ---- src/ResourceManager/Dns/Commands.Dns/Commands.Dns.csproj | 4 ---- .../Commands.HDInsight.Test/Commands.HDInsight.Test.csproj | 4 ---- .../HDInsight/Commands.HDInsight/Commands.HDInsight.csproj | 4 ---- .../Commands.Insights.Test/Commands.Insights.Test.csproj | 4 ---- .../Insights/Commands.Insights/Commands.Insights.csproj | 4 ---- .../Commands.KeyVault.Test/Commands.KeyVault.Test.csproj | 4 ---- .../KeyVault/Commands.KeyVault/Commands.KeyVault.csproj | 4 ---- .../Commands.Network.Test/Commands.Network.Test.csproj | 4 ---- .../Network/Commands.Network/Commands.Network.csproj | 4 ---- .../Commands.OperationalInsights.Test.csproj | 4 ---- .../Commands.OperationalInsights.csproj | 4 ---- .../Commands.RedisCache.Test.csproj | 4 ---- .../Commands.RedisCache/Commands.RedisCache.csproj | 4 ---- .../Cmdlets/Commands.ResourceManager.Cmdlets.csproj | 4 ---- .../Commands.Resources.Test/Commands.Resources.Test.csproj | 4 ---- .../Resources/Commands.Resources/Commands.Resources.csproj | 4 ---- .../Commands.SiteRecovery/Commands.SiteRecovery.csproj | 6 +----- .../Sql/Commands.Sql.Test/Commands.Sql.Test.csproj | 6 +----- src/ResourceManager/Sql/Commands.Sql/Commands.Sql.csproj | 6 +----- .../Commands.Management.Storage.Test.csproj | 4 ---- .../Commands.Management.Storage.csproj | 4 ---- .../Commands.StreamAnalytics.Test.csproj | 6 +----- .../Commands.StreamAnalytics.csproj | 6 +----- src/ResourceManager/Tags/Commands.Tags/Commands.Tags.csproj | 6 +----- .../Commands.TrafficManager2.Test.csproj | 6 +----- .../Commands.TrafficManager2.csproj | 6 +----- .../Commands.Websites.Test/Commands.Websites.Test.csproj | 6 +----- .../Websites/Commands.Websites/Commands.Websites.csproj | 6 +----- .../Commands.Automation.Test.csproj | 4 ---- .../Commands.Automation/Commands.Automation.csproj | 4 ---- ...ommands.ServiceManagement.PlatformImageRepository.csproj | 6 +----- .../Commands.ServiceManagement.Preview.csproj | 6 +----- .../Commands.ServiceManagement.Test.csproj | 6 +----- .../Commands.ServiceManagement.csproj | 6 +----- .../Commands.ExpressRoute/Commands.ExpressRoute.csproj | 4 ---- .../Commands.HDInsight.Test/Commands.HDInsight.Test.csproj | 4 ---- .../HDInsight/Commands.HDInsight/HDInsight.csproj | 6 +----- .../Commands.ManagedCache.Test.csproj | 4 ---- .../Commands.ManagedCache/Commands.ManagedCache.csproj | 4 ---- .../Commands.ServiceManagement.Network.Test.csproj | 6 +----- .../Commands.ServiceManagement.Network.csproj | 6 +----- .../Commands.RecoveryServices.Test.csproj | 4 ---- .../Commands.RecoveryServices.csproj | 4 ---- .../Commands.RemoteApp.Test/Commands.RemoteApp.Test.csproj | 4 ---- .../RemoteApp/Commands.RemoteApp/Commands.RemoteApp.csproj | 4 ---- .../Commands.Test.Utilities/Commands.Test.Utilities.csproj | 6 +----- .../Services/Commands.Test/Commands.Test.csproj | 6 +----- .../Services/Commands.Utilities/Commands.Utilities.csproj | 6 +----- src/ServiceManagement/Services/Commands/Commands.csproj | 4 ---- .../Commands.SqlDatabase.Test.csproj | 6 +----- .../Sql/Commands.SqlDatabase/Commands.SqlDatabase.csproj | 6 +----- .../Commands.Storage.ScenarioTest.csproj | 6 +----- .../Commands.Storage.Test/Commands.Storage.Test.csproj | 6 +----- .../Storage/Commands.Storage/Commands.Storage.csproj | 6 +----- .../Commands.TrafficManager.Test.csproj | 6 +----- .../Commands.TrafficManager/Commands.TrafficManager.csproj | 6 +----- 82 files changed, 32 insertions(+), 360 deletions(-) diff --git a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj index 588c8a15e5fc..1577eb684c97 100644 --- a/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj +++ b/src/Common/Commands.Common.Storage/Commands.Common.Storage.csproj @@ -184,8 +184,4 @@ - - - - \ No newline at end of file diff --git a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj index feaa9858aa8f..775e3ffee8fc 100644 --- a/src/Common/Commands.Common.Test/Commands.Common.Test.csproj +++ b/src/Common/Commands.Common.Test/Commands.Common.Test.csproj @@ -305,10 +305,6 @@ - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. diff --git a/src/Common/Commands.Common/Commands.Common.csproj b/src/Common/Commands.Common/Commands.Common.csproj index d78e6a93ba52..cdc01e00f5a1 100644 --- a/src/Common/Commands.Common/Commands.Common.csproj +++ b/src/Common/Commands.Common/Commands.Common.csproj @@ -205,8 +205,4 @@ - - - - \ No newline at end of file diff --git a/src/Common/Commands.Profile/Commands.Profile.csproj b/src/Common/Commands.Profile/Commands.Profile.csproj index 2048bc5c31f9..06d24374ff8b 100644 --- a/src/Common/Commands.Profile/Commands.Profile.csproj +++ b/src/Common/Commands.Profile/Commands.Profile.csproj @@ -178,8 +178,4 @@ - - - - \ No newline at end of file diff --git a/src/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj b/src/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj index e25272568f43..d27f28f79113 100644 --- a/src/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj +++ b/src/Common/Commands.ResourceManager.Common/Commands.ResourceManager.Common.csproj @@ -206,8 +206,4 @@ - - - - \ No newline at end of file diff --git a/src/Common/Commands.ResourceManager.Profile.Test/Commands.ResourceManager.Profile.Test.csproj b/src/Common/Commands.ResourceManager.Profile.Test/Commands.ResourceManager.Profile.Test.csproj index 7e2a51bdd196..cf5c554db81d 100644 --- a/src/Common/Commands.ResourceManager.Profile.Test/Commands.ResourceManager.Profile.Test.csproj +++ b/src/Common/Commands.ResourceManager.Profile.Test/Commands.ResourceManager.Profile.Test.csproj @@ -228,8 +228,4 @@ - - - - \ No newline at end of file diff --git a/src/Common/Commands.ResourceManager.Profile/Commands.ResourceManager.Profile.csproj b/src/Common/Commands.ResourceManager.Profile/Commands.ResourceManager.Profile.csproj index 48cf8b4c98fb..dfb5ac988bc4 100644 --- a/src/Common/Commands.ResourceManager.Profile/Commands.ResourceManager.Profile.csproj +++ b/src/Common/Commands.ResourceManager.Profile/Commands.ResourceManager.Profile.csproj @@ -181,8 +181,4 @@ - - - - \ No newline at end of file diff --git a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj index 991b67cce732..f4648e83ce4e 100644 --- a/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj +++ b/src/Common/Commands.ScenarioTest/Commands.ScenarioTest.csproj @@ -585,10 +585,6 @@ - - - - This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. diff --git a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj index 28c6ed516e94..7e37ef305660 100644 --- a/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj +++ b/src/Common/Commands.ScenarioTests.Common/Commands.ScenarioTests.Common.csproj @@ -170,10 +170,6 @@ - - - - diff --git a/src/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj b/src/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj index f0b77bcd41fb..094a266b93d2 100644 --- a/src/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj +++ b/src/Common/Commands.ScenarioTests.ResourceManager.Common/Commands.ScenarioTests.ResourceManager.Common.csproj @@ -179,10 +179,6 @@ - - - - diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj index a373866a0fdf..b9cd2f49eedb 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.ServiceManagement/Commands.ApiManagement.ServiceManagement.csproj @@ -262,10 +262,6 @@ - - - - diff --git a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj index 05b75b4e1b0d..941c26b6041a 100644 --- a/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj +++ b/src/ResourceManager/ApiManagement/Commands.ApiManagement.Test/Commands.ApiManagement.Test.csproj @@ -212,10 +212,6 @@ - - - - - - - - + - - + Condition="!$(DelaySign) and '@(DelaySignedAssembliesToValidate)' != ''"/> @@ -285,25 +288,24 @@ - + - - + - + - - diff --git a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj index ed8f0fd1bee0..3d890c5a0f23 100644 --- a/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj +++ b/src/ServiceManagement/RecoveryServices/Commands.RecoveryServices/Commands.RecoveryServices.csproj @@ -249,9 +249,6 @@ - - - - + 31bf3856ad364e35 @@ -231,54 +201,54 @@ - - - - + + + + Condition="'@(DelaySignedAssembliesToSign)' == ''" /> + Condition="'@(DelaySignedAssembliesToSign)' != ''"/> - - + Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/> - - + + Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/> - + 31bf3856ad364e35 @@ -288,24 +258,24 @@ - + + Condition="'@(InstallersToSign)' == ''" /> + Condition="!$(DelaySign) and '@(InstallersToSign)' != ''"/> - + From 143be979b997eff8fd8c847c62529d53cb93ff94 Mon Sep 17 00:00:00 2001 From: stankovski Date: Mon, 21 Sep 2015 11:23:13 -0700 Subject: [PATCH 08/12] Added step to sign ShortcutStartup. --- build.proj | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/build.proj b/build.proj index 6a29d498a518..aa9c8ced86ea 100644 --- a/build.proj +++ b/build.proj @@ -200,6 +200,10 @@ + + + @@ -246,6 +250,10 @@ ExpectedDelaySigned="false" ContinueOnError="false" Condition="!$(DelaySign) and '@(DelaySignedAssembliesToSign)' != ''"/> + + + From a4f609d59e41d90f58dc143f0b1e54381d1b3175 Mon Sep 17 00:00:00 2001 From: stankovski Date: Mon, 21 Sep 2015 11:51:56 -0700 Subject: [PATCH 09/12] Addressed code review feedback --- setup-powershellget/Setup/ShortcutStartup.ps1 | 25 ++++++------------- 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/setup-powershellget/Setup/ShortcutStartup.ps1 b/setup-powershellget/Setup/ShortcutStartup.ps1 index 54b434483269..ba35b2cc15c0 100644 --- a/setup-powershellget/Setup/ShortcutStartup.ps1 +++ b/setup-powershellget/Setup/ShortcutStartup.ps1 @@ -11,28 +11,17 @@ # See the License for the specific language governing permissions and # limitations under the License. # ---------------------------------------------------------------------------------- +[CmdletBinding()] +Param( +[Parameter(Mandatory=$False, HelpMessage="Use Install parameter to install Azure modules from PowerShell Gallery.")] +[switch]$Install +) -function Get-ScriptDirectory -{ - $Invocation = (Get-Variable MyInvocation -Scope 1).Value - Split-Path $Invocation.MyCommand.Path -} - -$modulePath = Join-Path $(Split-Path (Get-ScriptDirectory)) "Azure.psd1" -Import-Module $modulePath cd c:\ $welcomeMessage = @" For a list of all Azure cmdlets type 'help azure'. -For a list of Windows Azure Pack cmdlets type 'Get-Command *wapack*'. -For Node.js cmdlets type 'help node-dev'. -For PHP cmdlets type 'help php-dev'. +For a list of Azure Pack cmdlets type 'Get-Command *wapack*'. "@ Write-Output $welcomeMessage -Set-ExecutionPolicy -Scope Process Undefined -Force -if ($(Get-ExecutionPolicy) -eq "Restricted") -{ - Set-ExecutionPolicy -Scope Process -ExecutionPolicy RemoteSigned -Force -} - -$VerbosePreference="Continue" \ No newline at end of file +$VerbosePreference = "Continue" \ No newline at end of file From 2c62aaea40098f757c8fca7c5684022159f6b819 Mon Sep 17 00:00:00 2001 From: stankovski Date: Mon, 21 Sep 2015 14:09:04 -0700 Subject: [PATCH 10/12] Downgraded xunit to 1.9 --- .../Commands.Profile.Test.csproj | 14 ++++---------- .../Profile/Commands.Profile.Test/packages.config | 7 ++----- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.csproj b/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.csproj index bedb0b428401..28ac587d6253 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.csproj +++ b/src/ResourceManager/Profile/Commands.Profile.Test/Commands.Profile.Test.csproj @@ -120,7 +120,6 @@ False ..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll - ..\..\..\packages\Microsoft.WindowsAzure.ConfigurationManager.2.0.3\lib\net35-full\Microsoft.WindowsAzure.Configuration.dll @@ -168,16 +167,12 @@ - - ..\..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll + + ..\..\..\packages\xunit.1.9.2\lib\net20\xunit.dll True - - ..\..\..\packages\xunit.assert.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll - True - - - ..\..\..\packages\xunit.extensibility.core.2.0.0\lib\portable-net45+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll + + ..\..\..\packages\xunit.extensions.1.9.2\lib\net20\xunit.extensions.dll True @@ -224,7 +219,6 @@ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - diff --git a/src/ResourceManager/Profile/Commands.Profile.Test/packages.config b/src/ResourceManager/Profile/Commands.Profile.Test/packages.config index a3082339b9ef..86e2df0e8f89 100644 --- a/src/ResourceManager/Profile/Commands.Profile.Test/packages.config +++ b/src/ResourceManager/Profile/Commands.Profile.Test/packages.config @@ -26,10 +26,7 @@ - - - - - + + \ No newline at end of file From 7b8f931a34c9122544f21124968dd18e6a6b8a0e Mon Sep 17 00:00:00 2001 From: stankovski Date: Mon, 21 Sep 2015 15:47:54 -0700 Subject: [PATCH 11/12] Fixed cursor "disappearance" in the shortcut #719 --- setup-powershellget/Setup/CustomAction.cs | 1 + setup-powershellget/Setup/ShellLink.cs | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/setup-powershellget/Setup/CustomAction.cs b/setup-powershellget/Setup/CustomAction.cs index 4fb665f4daf5..916f0a70211e 100644 --- a/setup-powershellget/Setup/CustomAction.cs +++ b/setup-powershellget/Setup/CustomAction.cs @@ -78,6 +78,7 @@ private static void RunSTAThread(object sessionObject) powerShellShellLink.SetScreenBufferSize(120, 3000); powerShellShellLink.SetWindowSize(120, 50); } + powerShellShellLink.SetFont(); powerShellShellLink.Save(); session.Log("UpdatePSShortcut: success"); } diff --git a/setup-powershellget/Setup/ShellLink.cs b/setup-powershellget/Setup/ShellLink.cs index 8668707bcc4a..80144cca986d 100644 --- a/setup-powershellget/Setup/ShellLink.cs +++ b/setup-powershellget/Setup/ShellLink.cs @@ -435,6 +435,14 @@ public void SetWindowSize(short x, short y) this.consoleProperties.dwWindowSize = c; } + public void SetFont() + { + this.consoleProperties.FaceName = "Lucida Console"; + this.consoleProperties.uFontFamily = 54; + this.consoleProperties.uFontWeight = 400; + this.consoleProperties.uCursorSize = 25; + } + // This does more than console colors private void SetConsoleProperties() { From 09cd46d7cbbd66c339cd931f635f6bd7e2500ffc Mon Sep 17 00:00:00 2001 From: stankovski Date: Mon, 21 Sep 2015 16:03:02 -0700 Subject: [PATCH 12/12] Fixed ShortcutStartup.ps1 execution from MSI. --- setup-powershellget/azurecmd.wxs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup-powershellget/azurecmd.wxs b/setup-powershellget/azurecmd.wxs index 077be99cd058..8680059fc809 100644 --- a/setup-powershellget/azurecmd.wxs +++ b/setup-powershellget/azurecmd.wxs @@ -102,7 +102,7 @@ - + NOT Installed