Skip to content

Add back UserAgents OM and update installer for PowerShell Get compatibility #1132

New issue

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

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

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Oct 19, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions setup/azurecmd.wxs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">

<?define productName="Microsoft Azure PowerShell - September 2015" ?>
<?define productName="Microsoft Azure PowerShell - October 2015" ?>
<?define sourceDir="$(var.SolutionDir)..\src\Package\$(var.Configuration)" ?>
<?define caSourceDir="$(var.SolutionDir)setup\bin\$(var.Configuration)" ?>

<?define version="0.9.9" ?>
<?define versionedStartMenuFolder="Microsoft Azure" ?>
<?define staleStartMenuFolder="Windows Azure" ?>

<Product Id="*"
Name="$(var.productName)"
Language="1033"
Expand All @@ -27,11 +27,29 @@
<Property Id="ARPPRODUCTICON" Value="icon.ico" />
<Property Id="ALLUSERS" Value="1" />
<!-- per machine install-->

<Property Id="PSCOMPATIBLEVERSION">
<RegistrySearch Id="PSCOMPATIBLEVERSION" Root="HKLM" Key="SOFTWARE\Microsoft\PowerShell\3\PowerShellEngine" Name="PSCompatibleVersion" Type="raw" />
</Property>

<SetProperty Action="SetBase64" Id="BaseModulesFolder" Value="[ProgramFiles64Folder]WindowsPowerShell\Modules" Before="AppSearch">
VersionNT64
</SetProperty>

<SetProperty Action="SetBase32" Id="BaseModulesFolder" Value="[ProgramFilesFolder]WindowsPowerShell\Modules" Before="AppSearch">
NOT VersionNT64
</SetProperty>

<Property Id="POWERSHELLGETMODULESINSTALLED" >
<DirectorySearch Id="PROGRAMFILESCONTAINER" Path="[BaseModulesFolder]">
<DirectorySearch Id= "PROFILEMODULE" Path="AzureRM.Profile"/>
</DirectorySearch>
</Property>

<Condition Message="Azure Modules from the PowerShell Gallery are installed on this machine. Please remove these modules before installing this MSI.">
<![CDATA[Installed or NOT(POWERSHELLGETMODULESINSTALLED >< "AzureRM.Profile")]]>
</Condition>


<Condition Message="This setup requires the Windows PowerShell 3.0 or compatible version to be installed.">
<!-- This condition will break if PowerShell has version x3.0 and it is not compatible with 3.0 -->
<![CDATA[Installed or (PSCOMPATIBLEVERSION >< "3.0")]]>
Expand Down Expand Up @@ -69,7 +87,7 @@
<Component Id="PSModulePath.System" Guid="273525B9-7AAB-421A-90C8-8E50A1840B8D">
<CreateFolder />
<!-- Work around bug that PowerShell does not always consider default module paths. -->
<Environment Id="PSModulePath.SystemAppRoot" Action="set" Name="PSMODULEPATH" Part="last" Value="[PowerShellFolder]ResourceManager;[PowerShellFolder]ServiceManagement" System="yes" />
<Environment Id="PSModulePath.SystemAppRoot" Action="set" Name="PSMODULEPATH" Part="last" Value="[BaseModulesFolder];[PowerShellFolder]ResourceManager;[PowerShellFolder]ServiceManagement" System="yes" />
</Component>
</DirectoryRef>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common.Storage/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common/AzurePSCmdlet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ protected override void EndProcessing()
DebugStreamTraceListener.RemoveAdalTracing(_adalListener);
FlushDebugMessages();

AzureSession.ClientFactory.UserAgents.RemoveAll(u => u.Product.Name == ModuleName);
AzureSession.ClientFactory.UserAgents.RemoveWhere(u => u.Product.Name == ModuleName);
AzureSession.ClientFactory.RemoveHandler(typeof(CmdletInfoHandler));
base.EndProcessing();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common/Commands.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<SpecificVersion>False</SpecificVersion>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Commands.Common/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<package id="Microsoft.ApplicationInsights" version="1.1.1-beta" targetFramework="net45" />
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
<package id="Microsoft.Bcl" version="1.1.9" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class MockClientFactory : IClientFactory

public MockClientFactory(IEnumerable<object> clients, bool throwIfClientNotSpecified = true)
{
UniqueUserAgents = new HashSet<ProductInfoHeaderValue>();
UserAgents = new HashSet<ProductInfoHeaderValue>();
ManagementClients = clients.ToList();
throwWhenNotAvailable = throwIfClientNotSpecified;
}
Expand Down Expand Up @@ -177,15 +177,15 @@ public void RemoveHandler(Type handlerType)

public void AddUserAgent(string productName, string productVersion)
{
throw new NotImplementedException();
this.UserAgents.Add(new ProductInfoHeaderValue(productName, productVersion));
}

public void AddUserAgent(string productName)
{
throw new NotImplementedException();
this.AddUserAgent(productName, string.Empty);
}

public HashSet<ProductInfoHeaderValue> UniqueUserAgents { get; set; }
public HashSet<ProductInfoHeaderValue> UserAgents { get; set; }

/// <summary>
/// This class exists to allow adding an additional reference to the httpClient to prevent the client
Expand Down Expand Up @@ -233,17 +233,5 @@ public TClient CreateCustomArmClient<TClient>(params object[] parameters) where

return client;
}

List<ProductInfoHeaderValue> IClientFactory.UserAgents
{
get
{
return this.UniqueUserAgents.ToList();
}
set
{
value.ForEach((v) => this.UniqueUserAgents.Add(v));
}
}
}
}
2 changes: 1 addition & 1 deletion src/Common/Commands.ScenarioTests.Common/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.Framework" version="1.0.5715.36130-prerelease" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.NetFramework.dll</HintPath>
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Storage/Commands.Storage.Test/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
2 changes: 1 addition & 1 deletion src/Common/Storage/Commands.Storage/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="AutoMapper" version="3.1.1" targetFramework="net45" />
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.ApiManagement" version="1.0.2-preview" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.ApiManagement" version="1.0.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<package id="AutoMapper" version="3.1.1" targetFramework="net45" />
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.KeyVault.Core" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.ApiManagement" version="1.0.2-preview" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.ApiManagement" version="1.0.2-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Gallery" version="2.6.2-preview" targetFramework="net45" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<HintPath>..\..\..\packages\Microsoft.Azure.Common.2.1.0\lib\net45\Microsoft.Azure.Common.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Azure.Common.Authentication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.3-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<HintPath>..\..\..\packages\Microsoft.Azure.Common.Authentication.1.3.4-preview\lib\net45\Microsoft.Azure.Common.Authentication.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.Azure.Common.NetFramework">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<packages>
<package id="Hyak.Common" version="1.0.2" targetFramework="net45" />
<package id="Microsoft.Azure.Common" version="2.1.0" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.3-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Authentication" version="1.3.4-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Common.Dependencies" version="1.0.0" targetFramework="net45" />
<package id="Microsoft.Azure.Management.Resources" version="2.18.7-preview" targetFramework="net45" />
<package id="Microsoft.Azure.Test.HttpRecorder" version="1.0.5715.36130-prerelease" targetFramework="net45" />
Expand Down
Loading