-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Az Installer #8139
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
Az Installer #8139
Changes from all commits
178eb26
93437fd
3ebbf2a
1f04562
5b14448
71c8f38
aae2f04
ab87e13
d70dd8d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| | ||
| Microsoft Visual Studio Solution File, Format Version 12.00 | ||
| # Visual Studio 15 | ||
| VisualStudioVersion = 15.0.27703.2042 | ||
| MinimumVisualStudioVersion = 10.0.40219.1 | ||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "InstallerChecks", "InstallerChecks\InstallerChecks.csproj", "{7EF9DF25-4A64-465E-B64C-76E0D6D94A93}" | ||
| EndProject | ||
| Global | ||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
| Debug|Any CPU = Debug|Any CPU | ||
| Debug|x64 = Debug|x64 | ||
| Debug|x86 = Debug|x86 | ||
| Release|Any CPU = Release|Any CPU | ||
| Release|x64 = Release|x64 | ||
| Release|x86 = Release|x86 | ||
| EndGlobalSection | ||
| GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
| {7EF9DF25-4A64-465E-B64C-76E0D6D94A93}.Debug|Any CPU.ActiveCfg = Debug|x64 | ||
| {7EF9DF25-4A64-465E-B64C-76E0D6D94A93}.Debug|x64.ActiveCfg = Debug|x64 | ||
| {7EF9DF25-4A64-465E-B64C-76E0D6D94A93}.Debug|x64.Build.0 = Debug|x64 | ||
| {7EF9DF25-4A64-465E-B64C-76E0D6D94A93}.Debug|x86.ActiveCfg = Debug|x64 | ||
| {7EF9DF25-4A64-465E-B64C-76E0D6D94A93}.Release|Any CPU.ActiveCfg = Release|x64 | ||
| {7EF9DF25-4A64-465E-B64C-76E0D6D94A93}.Release|x64.ActiveCfg = Release|x64 | ||
| {7EF9DF25-4A64-465E-B64C-76E0D6D94A93}.Release|x64.Build.0 = Release|x64 | ||
| {7EF9DF25-4A64-465E-B64C-76E0D6D94A93}.Release|x86.ActiveCfg = Release|x64 | ||
| EndGlobalSection | ||
| GlobalSection(SolutionProperties) = preSolution | ||
| HideSolutionNode = FALSE | ||
| EndGlobalSection | ||
| GlobalSection(ExtensibilityGlobals) = postSolution | ||
| SolutionGuid = {89994462-D746-4F79-8205-4407E6549E10} | ||
| EndGlobalSection | ||
| EndGlobal |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <configuration> | ||
| <startup useLegacyV2RuntimeActivationPolicy="true"> | ||
|
|
||
| <!-- | ||
| Use supportedRuntime tags to explicitly specify the version(s) of the .NET Framework runtime that | ||
| the custom action should run on. If no versions are specified, the chosen version of the runtime | ||
| will be the "best" match to what Microsoft.Deployment.WindowsInstaller.dll was built against. | ||
|
|
||
| WARNING: leaving the version unspecified is dangerous as it introduces a risk of compatibility | ||
| problems with future versions of the .NET Framework runtime. It is highly recommended that you specify | ||
| only the version(s) of the .NET Framework runtime that you have tested against. | ||
|
|
||
| Note for .NET Framework v3.0 and v3.5, the runtime version is still v2.0. | ||
|
|
||
| In order to enable .NET Framework version 2.0 runtime activation policy, which is to load all assemblies | ||
| by using the latest supported runtime, @useLegacyV2RuntimeActivationPolicy="true". | ||
|
|
||
| For more information, see http://msdn.microsoft.com/en-us/library/bbx34a2h.aspx | ||
| --> | ||
|
|
||
| <supportedRuntime version="v4.0" /> | ||
| <supportedRuntime version="v2.0.50727"/> | ||
|
|
||
| </startup> | ||
|
|
||
| <!-- | ||
| Add additional configuration settings here. For more information on application config files, | ||
| see http://msdn.microsoft.com/en-us/library/kza1yk3a.aspx | ||
| --> | ||
|
|
||
| </configuration> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| using Microsoft.Deployment.WindowsInstaller; | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.IO; | ||
| using System.Linq; | ||
|
|
||
| namespace InstallerChecks | ||
| { | ||
| public class InstallerChecks | ||
| { | ||
| [CustomAction] | ||
| public static ActionResult CheckForAzureRm(Session session) | ||
| { | ||
| List<string> AzureModules = new List<string> { "Azure.AnalysisServices", "Azure.Storage", "AzureRM", "AzureRM.AnalysisServices", | ||
| "AzureRM.ApiManagement", "AzureRM.ApplicationInsights", "AzureRM.Automation", "AzureRM.Backup", "AzureRM.Batch", "AzureRM.Billing", | ||
| "AzureRM.Cdn", "AzureRM.CognitiveServices", "AzureRM.Compute", "AzureRM.Compute.Experiments", "AzureRM.Consumption", | ||
| "AzureRM.ContainerInstance", "AzureRM.ContainerRegistry", "AzureRM.DataFactories", "AzureRM.DataFactoryV2", "AzureRM.DataLakeAnalytics", | ||
| "AzureRM.DataLakeStore", "AzureRM.DataMigration", "AzureRM.DevTestLabs", "AzureRM.Dns", "AzureRM.EventGrid", "AzureRM.EventHub", | ||
| "AzureRM.HDInsight", "AzureRM.Insights", "AzureRM.IotHub", "AzureRM.KeyVault", "AzureRM.LogicApp", "AzureRM.MachineLearning", | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is OK for now, but I worry about maintaining this over time as we add modules - we should look for a way to get this information from the build. |
||
| "AzureRM.MachineLearningCompute", "AzureRM.ManagementPartner", "AzureRM.Maps", "AzureRM.MarketplaceOrdering", "AzureRM.Media", | ||
| "AzureRM.Network", "AzureRM.NotificationHubs", "AzureRM.OperationalInsights", "AzureRM.PolicyInsights", "AzureRM.PowerBIEmbedded", | ||
| "AzureRM.profile", "AzureRM.RecoveryServices", "AzureRM.RecoveryServices.Backup", "AzureRM.RecoveryServices.SiteRecovery", | ||
| "AzureRM.RedisCache", "AzureRM.Relay", "AzureRM.Reservations", "AzureRM.Resources", "AzureRM.Scheduler", "AzureRM.ServerManagement", | ||
| "AzureRM.ServiceBus", "AzureRM.ServiceFabric", "AzureRM.SignalR", "AzureRM.SiteRecovery", "AzureRM.Sql", "AzureRM.Storage", | ||
| "AzureRM.StreamAnalytics", "AzureRM.Subscription.Preview", "AzureRM.Tags", "AzureRM.TrafficManager", "AzureRM.UsageAggregates", | ||
| "AzureRM.Websites", "AzureRM.Websites.Experiments"}; | ||
|
|
||
| session.Log("Begin CustomAction"); | ||
| var paths = Environment.GetEnvironmentVariable("PSModulePath").Split(';'); | ||
| foreach (var path in paths) | ||
| { | ||
| if (Directory.Exists(path)) | ||
| { | ||
| var modules = Directory.GetDirectories(path); | ||
| foreach (var module in modules) | ||
| { | ||
| var moduleName = module.Split(Path.DirectorySeparatorChar).LastOrDefault(); | ||
| if (AzureModules.Any(x => string.Equals(x, moduleName, StringComparison.OrdinalIgnoreCase))) | ||
| { | ||
| Record record = new Record(2); | ||
| record.FormatString = Properties.Resources.AzureRmDetected; | ||
| session.Message(InstallMessage.Error, record); | ||
| return ActionResult.Failure; | ||
| } | ||
| } | ||
| } | ||
| } | ||
| return ActionResult.Success; | ||
| } | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
markcowl marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| <Project ToolsVersion="4.0" DefaultTargets="Build" InitialTargets="EnsureWixToolsetInstalled" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
| <PropertyGroup> | ||
| <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
| <Platform Condition=" '$(Platform)' == '' ">x64</Platform> | ||
| <ProductVersion>8.0.30703</ProductVersion> | ||
| <SchemaVersion>2.0</SchemaVersion> | ||
| <ProjectGuid>{7EF9DF25-4A64-465E-B64C-76E0D6D94A93}</ProjectGuid> | ||
| <OutputType>Library</OutputType> | ||
| <AppDesignerFolder>Properties</AppDesignerFolder> | ||
| <RootNamespace>InstallerChecks</RootNamespace> | ||
| <AssemblyName>InstallerChecks</AssemblyName> | ||
| <TargetFrameworkVersion>v3.5</TargetFrameworkVersion> | ||
| <FileAlignment>512</FileAlignment> | ||
| <TargetFrameworkProfile /> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'"> | ||
| <DebugSymbols>true</DebugSymbols> | ||
| <OutputPath>bin\Debug\</OutputPath> | ||
| <DefineConstants>DEBUG;TRACE</DefineConstants> | ||
| <DebugType>full</DebugType> | ||
| <PlatformTarget>x64</PlatformTarget> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | ||
| </PropertyGroup> | ||
| <PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'"> | ||
| <OutputPath>bin\Release\</OutputPath> | ||
| <DefineConstants>TRACE</DefineConstants> | ||
| <Optimize>true</Optimize> | ||
| <DebugType>pdbonly</DebugType> | ||
| <PlatformTarget>x64</PlatformTarget> | ||
| <ErrorReport>prompt</ErrorReport> | ||
| <CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet> | ||
| </PropertyGroup> | ||
| <ItemGroup> | ||
| <Reference Include="System" /> | ||
| <Reference Include="System.Core" /> | ||
| <Reference Include="System.Xml.Linq" /> | ||
| <Reference Include="Microsoft.CSharp" /> | ||
| <Reference Include="System.Xml" /> | ||
| <Reference Include="Microsoft.Deployment.WindowsInstaller"> | ||
| <Private>True</Private> | ||
| </Reference> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <Compile Include="InstallerChecks.cs" /> | ||
| <Compile Include="Properties\AssemblyInfo.cs" /> | ||
| <Compile Include="Properties\Resources.Designer.cs"> | ||
| <AutoGen>True</AutoGen> | ||
| <DesignTime>True</DesignTime> | ||
| <DependentUpon>Resources.resx</DependentUpon> | ||
| </Compile> | ||
| <Content Include="InstallerChecks.config" /> | ||
| </ItemGroup> | ||
| <ItemGroup> | ||
| <EmbeddedResource Include="Properties\Resources.resx"> | ||
| <Generator>ResXFileCodeGenerator</Generator> | ||
| <LastGenOutput>Resources.Designer.cs</LastGenOutput> | ||
| </EmbeddedResource> | ||
| </ItemGroup> | ||
| <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> | ||
| <Import Project="$(WixCATargetsPath)" Condition=" '$(WixCATargetsPath)' != '' " /> | ||
| <Import Project="$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.CA.targets" Condition=" '$(WixCATargetsPath)' == '' AND Exists('$(MSBuildExtensionsPath32)\Microsoft\WiX\v3.x\Wix.CA.targets') " /> | ||
| <Target Name="EnsureWixToolsetInstalled" Condition=" '$(WixCATargetsImported)' != 'true' "> | ||
| <Error Text="The WiX Toolset v3.11 (or newer) build tools must be installed to build this project. To download the WiX Toolset, see http://wixtoolset.org/releases/" /> | ||
| </Target> | ||
| </Project> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| using System.Reflection; | ||
| using System.Runtime.CompilerServices; | ||
| using System.Runtime.InteropServices; | ||
|
|
||
| // General Information about an assembly is controlled through the following | ||
| // set of attributes. Change these attribute values to modify the information | ||
| // associated with an assembly. | ||
| [assembly: AssemblyTitle("InstallerChecks")] | ||
| [assembly: AssemblyDescription("")] | ||
| [assembly: AssemblyCompany("")] | ||
| [assembly: AssemblyProduct("InstallerChecks")] | ||
| [assembly: AssemblyCopyright("Copyright © 2018")] | ||
| [assembly: AssemblyTrademark("")] | ||
| [assembly: AssemblyCulture("")] | ||
|
|
||
| // Setting ComVisible to false makes the types in this assembly not visible | ||
| // to COM components. If you need to access a type in this assembly from | ||
| // COM, set the ComVisible attribute to true on that type. | ||
| [assembly: ComVisible(false)] | ||
|
|
||
| // The following GUID is for the ID of the typelib if this project is exposed to COM | ||
| [assembly: Guid("f2ac8c5c-97a7-4b8e-97bd-ed30ac1135e5")] | ||
|
|
||
| // Version information for an assembly consists of the following four values: | ||
| // | ||
| // Major Version | ||
| // Minor Version | ||
| // Build Number | ||
| // Revision | ||
| // | ||
| // You can specify all the values or you can default the Build and Revision Numbers | ||
| // by using the '*' as shown below: | ||
| // [assembly: AssemblyVersion("1.0.*")] | ||
| [assembly: AssemblyVersion("1.0.0.0")] | ||
| [assembly: AssemblyFileVersion("1.0.0.0")] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.