diff --git a/.build.custom/ilmerge.replace.build b/.build.custom/ilmerge.replace.build index 4670bb8c28..d22a82aaa4 100644 --- a/.build.custom/ilmerge.replace.build +++ b/.build.custom/ilmerge.replace.build @@ -73,7 +73,7 @@ - + true + + bin\x86\NoResources\ + TRACE;NoResources + true + true + x86 + prompt + MinimumRecommendedRules.ruleset + + + bin\NoResources\ + TRACE;NoResources + true + true + AnyCPU + prompt + MinimumRecommendedRules.ruleset + false + false + False @@ -124,11 +144,17 @@ + + + + + {AF584111-FE32-448D-A1D0-63217AF8B43C} + chocolatey.resources + + + + - - {AF584111-FE32-448D-A1D0-63217AF8B43C} - chocolatey.resources - {5563DC61-35FD-4FAB-B331-9AE1FDB23F80} chocolatey @@ -148,4 +174,4 @@ --> - \ No newline at end of file + diff --git a/src/chocolatey.resources/chocolatey.resources.csproj b/src/chocolatey.resources/chocolatey.resources.csproj index e9c01bcb5c..2db35b6dd1 100644 --- a/src/chocolatey.resources/chocolatey.resources.csproj +++ b/src/chocolatey.resources/chocolatey.resources.csproj @@ -30,6 +30,14 @@ prompt 4 + + bin\NoResources\ + TRACE + true + AnyCPU + prompt + MinimumRecommendedRules.ruleset + @@ -174,4 +182,4 @@ --> - \ No newline at end of file + diff --git a/src/chocolatey.sln b/src/chocolatey.sln index 312df24d2d..2a44908f3f 100644 --- a/src/chocolatey.sln +++ b/src/chocolatey.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2010 +# Visual Studio 15 +VisualStudioVersion = 15.0.27130.2027 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "chocolatey.console", "chocolatey.console\chocolatey.console.csproj", "{E24E3386-244F-4404-9E6E-5B53818EA903}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "chocolatey.tests", "chocolatey.tests\chocolatey.tests.csproj", "{5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}" @@ -50,6 +52,9 @@ Global Debug|Any CPU = Debug|Any CPU Debug|Mixed Platforms = Debug|Mixed Platforms Debug|x86 = Debug|x86 + NoResources|Any CPU = NoResources|Any CPU + NoResources|Mixed Platforms = NoResources|Mixed Platforms + NoResources|x86 = NoResources|x86 Release|Any CPU = Release|Any CPU Release|Mixed Platforms = Release|Mixed Platforms Release|x86 = Release|x86 @@ -61,6 +66,9 @@ Global {E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|x86.ActiveCfg = Debug|x86 {E24E3386-244F-4404-9E6E-5B53818EA903}.Debug|x86.Build.0 = Debug|x86 + {E24E3386-244F-4404-9E6E-5B53818EA903}.NoResources|Any CPU.ActiveCfg = NoResources|Any CPU + {E24E3386-244F-4404-9E6E-5B53818EA903}.NoResources|Mixed Platforms.ActiveCfg = NoResources|x86 + {E24E3386-244F-4404-9E6E-5B53818EA903}.NoResources|x86.ActiveCfg = NoResources|x86 {E24E3386-244F-4404-9E6E-5B53818EA903}.Release|Any CPU.ActiveCfg = Release|Any CPU {E24E3386-244F-4404-9E6E-5B53818EA903}.Release|Any CPU.Build.0 = Release|Any CPU {E24E3386-244F-4404-9E6E-5B53818EA903}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -72,6 +80,9 @@ Global {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.Debug|x86.ActiveCfg = Debug|Any CPU + {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.NoResources|Any CPU.ActiveCfg = NoResources|Any CPU + {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.NoResources|Mixed Platforms.ActiveCfg = NoResources|Any CPU + {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.NoResources|x86.ActiveCfg = NoResources|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.Release|Any CPU.ActiveCfg = Release|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.Release|Any CPU.Build.0 = Release|Any CPU {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -82,6 +93,12 @@ Global {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.Debug|x86.ActiveCfg = Debug|Any CPU + {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.NoResources|Any CPU.ActiveCfg = NoResources|Any CPU + {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.NoResources|Any CPU.Build.0 = NoResources|Any CPU + {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.NoResources|Mixed Platforms.ActiveCfg = NoResources|Any CPU + {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.NoResources|Mixed Platforms.Build.0 = NoResources|Any CPU + {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.NoResources|x86.ActiveCfg = NoResources|Any CPU + {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.NoResources|x86.Build.0 = NoResources|Any CPU {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.Release|Any CPU.ActiveCfg = Release|Any CPU {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.Release|Any CPU.Build.0 = Release|Any CPU {5563DC61-35FD-4FAB-B331-9AE1FDB23F80}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -92,6 +109,9 @@ Global {AF584111-FE32-448D-A1D0-63217AF8B43C}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {AF584111-FE32-448D-A1D0-63217AF8B43C}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {AF584111-FE32-448D-A1D0-63217AF8B43C}.Debug|x86.ActiveCfg = Debug|Any CPU + {AF584111-FE32-448D-A1D0-63217AF8B43C}.NoResources|Any CPU.ActiveCfg = NoResources|Any CPU + {AF584111-FE32-448D-A1D0-63217AF8B43C}.NoResources|Mixed Platforms.ActiveCfg = NoResources|Any CPU + {AF584111-FE32-448D-A1D0-63217AF8B43C}.NoResources|x86.ActiveCfg = NoResources|Any CPU {AF584111-FE32-448D-A1D0-63217AF8B43C}.Release|Any CPU.ActiveCfg = Release|Any CPU {AF584111-FE32-448D-A1D0-63217AF8B43C}.Release|Any CPU.Build.0 = Release|Any CPU {AF584111-FE32-448D-A1D0-63217AF8B43C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -102,6 +122,9 @@ Global {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.Debug|x86.ActiveCfg = Debug|Any CPU + {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.NoResources|Any CPU.ActiveCfg = NoResources|Any CPU + {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.NoResources|Mixed Platforms.ActiveCfg = NoResources|Any CPU + {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.NoResources|x86.ActiveCfg = NoResources|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.Release|Any CPU.ActiveCfg = Release|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.Release|Any CPU.Build.0 = Release|Any CPU {12ECAD4F-D463-4D72-A792-A4FCCFE9C456}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU @@ -115,7 +138,10 @@ Global {5C4C60F0-47B1-498E-ABF7-D315E1A94BC9} = {7656D054-387D-409C-A9FB-62A44599AA77} {12ECAD4F-D463-4D72-A792-A4FCCFE9C456} = {7656D054-387D-409C-A9FB-62A44599AA77} {DAB29F30-149D-4005-A8D2-4FA56CF2784D} = {FB6236DD-17EF-4C36-943C-47792FBC3306} - {DD9689F3-1D2D-41AE-A672-063EE70C0C9A} = {FB6236DD-17EF-4C36-943C-47792FBC3306} {E5C987F8-6B95-4835-BBDD-A25C9D370BB9} = {DAB29F30-149D-4005-A8D2-4FA56CF2784D} + {DD9689F3-1D2D-41AE-A672-063EE70C0C9A} = {FB6236DD-17EF-4C36-943C-47792FBC3306} + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {998CAC46-A2B8-447C-B4CC-3B11DC35ED46} EndGlobalSection EndGlobal diff --git a/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj b/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj index 484552e747..f193f467e1 100644 --- a/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj +++ b/src/chocolatey.tests.integration/chocolatey.tests.integration.csproj @@ -32,6 +32,15 @@ prompt 4 + + bin\NoResources\ + TRACE + true + pdbonly + AnyCPU + prompt + MinimumRecommendedRules.ruleset + ..\..\lib\bdddoc\bdddoc.dll @@ -501,4 +510,4 @@ --> - \ No newline at end of file + diff --git a/src/chocolatey.tests/chocolatey.tests.csproj b/src/chocolatey.tests/chocolatey.tests.csproj index b0880ef870..85336ad736 100644 --- a/src/chocolatey.tests/chocolatey.tests.csproj +++ b/src/chocolatey.tests/chocolatey.tests.csproj @@ -31,6 +31,15 @@ prompt 4 + + bin\NoResources\ + TRACE + true + pdbonly + AnyCPU + prompt + MinimumRecommendedRules.ruleset + ..\packages\log4net.2.0.3\lib\net40-client\log4net.dll @@ -129,4 +138,4 @@ --> - \ No newline at end of file + diff --git a/src/chocolatey/GetChocolatey.cs b/src/chocolatey/GetChocolatey.cs index 8a80b72059..09f04f0c4e 100644 --- a/src/chocolatey/GetChocolatey.cs +++ b/src/chocolatey/GetChocolatey.cs @@ -1,13 +1,13 @@ // Copyright © 2017 Chocolatey Software, Inc // Copyright © 2011 - 2017 RealDimensions Software, LLC -// +// // 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. @@ -30,7 +30,9 @@ namespace chocolatey using infrastructure.logging; using infrastructure.registration; using infrastructure.synchronization; +#if !NoResources using resources; +#endif using Assembly = infrastructure.adapters.Assembly; using IFileSystem = infrastructure.filesystem.IFileSystem; @@ -183,7 +185,7 @@ public GetChocolatey RegisterContainerComponent(Type service, Type implementatio } /// - /// Registers a container component. Does not require a dependency on Simple Injector. + /// Registers a container component. Does not require a dependency on Simple Injector. /// Will override existing component if registered. /// /// The type of the service. @@ -200,7 +202,7 @@ public GetChocolatey RegisterContainerComponent() } /// - /// Registers a container component. + /// Registers a container component. /// Will override existing component if registered. /// /// The type of the service. @@ -219,7 +221,7 @@ public GetChocolatey RegisterContainerComponent(Lifesty } /// - /// Registers a container component. Does not require a dependency on Simple Injector. + /// Registers a container component. Does not require a dependency on Simple Injector. /// Will override existing component if registered. /// /// The type of the ervice. @@ -236,7 +238,7 @@ public GetChocolatey RegisterContainerComponent(Func implement } /// - /// Register container components when you need to do multiple setups and want to work with the container directly. + /// Register container components when you need to do multiple setups and want to work with the container directly. /// Will override existing components if registered. /// /// The container setup. @@ -255,7 +257,7 @@ public GetChocolatey RegisterContainerComponents(Action containerSetu } /// - /// Returns the Chocolatey container. + /// Returns the Chocolatey container. /// WARNING: Once you call GetInstance of any kind, no more items can be registered on the container /// /// The IoC Container (implemented as a SimpleInjector.Container) @@ -270,7 +272,7 @@ public Container Container() /// /// Call this method to run Chocolatey after you have set the options. /// WARNING: Once this is called, you will not be able to register additional container components. - /// WARNING: Ensure you don't nest additional calls to running Chocolatey here. + /// WARNING: Ensure you don't nest additional calls to running Chocolatey here. /// Make a call, then finish up and make another call. This includes /// - Run() /// - RunConsole() @@ -296,7 +298,7 @@ public void Run() /// /// Call this method to run chocolatey after you have set the options. /// WARNING: Once this is called, you will not be able to register additional container components. - /// WARNING: Ensure you don't nest additional calls to running Chocolatey here. + /// WARNING: Ensure you don't nest additional calls to running Chocolatey here. /// Make a call, then finish up and make another call. This includes /// - Run() /// - RunConsole() @@ -321,7 +323,7 @@ public void RunConsole(string[] args) /// /// Run chocolatey after setting the options, and list the results. /// WARNING: Once this is called, you will not be able to register additional container components. - /// WARNING: Ensure you don't nest additional calls to running Chocolatey here. + /// WARNING: Ensure you don't nest additional calls to running Chocolatey here. /// Make a call, then finish up and make another call. This includes /// - Run() /// - RunConsole() @@ -346,7 +348,7 @@ public IEnumerable List() /// Run chocolatey after setting the options, /// and get the count of items that would be returned if you listed the results. /// WARNING: Once this is called, you will not be able to register additional container components. - /// WARNING: Ensure you don't nest additional calls to running Chocolatey here. + /// WARNING: Ensure you don't nest additional calls to running Chocolatey here. /// Make a call, then finish up and make another call. This includes /// - Run() /// - RunConsole() @@ -400,9 +402,9 @@ private void ensure_original_configuration(IList args, Action - /// After the construction of GetChocolatey, we should have a ChocolateyConfiguration or LicensedChocolateyConfiguration loaded into the environment. - /// We want that original configuration to live on between calls to the API. This function ensures that the - /// original default configuration from new() is reset after each command finishes running, even as each command + /// After the construction of GetChocolatey, we should have a ChocolateyConfiguration or LicensedChocolateyConfiguration loaded into the environment. + /// We want that original configuration to live on between calls to the API. This function ensures that the + /// original default configuration from new() is reset after each command finishes running, even as each command /// may make changes to the configuration it uses. /// /// @@ -438,7 +440,7 @@ private T ensure_original_configuration(IList args, Func - /// Creates the configuration. + /// Creates the configuration. /// This should never be called directly, as it can cause issues that are very difficult to debug. /// /// The arguments. @@ -498,6 +500,7 @@ private void extract_resources() "tools" }; +#if !NoResources try { AssemblyFileExtractor.extract_all_resources_to_relative_directory(_container.GetInstance(), Assembly.GetAssembly(typeof(ChocolateyResourcesAssembly)), ApplicationParameters.InstallLocation, folders, ApplicationParameters.ChocolateyFileResources); @@ -507,7 +510,7 @@ private void extract_resources() this.Log().Warn(ChocolateyLoggers.Important, "Please ensure that ChocolateyInstall environment variable is set properly and you've run once as an administrator to ensure all resources are extracted."); this.Log().Error("Unable to extract resources. Please ensure the ChocolateyInstall environment variable is set properly. You may need to run once as an admin to ensure all resources are extracted. Details:{0} {1}".format_with(Environment.NewLine, ex.ToString())); } - +#endif } } diff --git a/src/chocolatey/chocolatey.csproj b/src/chocolatey/chocolatey.csproj index 6643d01634..1e2dd0664a 100644 --- a/src/chocolatey/chocolatey.csproj +++ b/src/chocolatey/chocolatey.csproj @@ -38,6 +38,18 @@ ..\..\docs\logo\chocolatey.ico + + true + bin\NoResources\ + TRACE;NoResources + true + bin\Release\chocolatey.xml + true + pdbonly + AnyCPU + prompt + MinimumRecommendedRules.ruleset + False @@ -328,12 +340,16 @@ Properties\chocolatey.ico - - - {AF584111-FE32-448D-A1D0-63217AF8B43C} - chocolatey.resources - - + + + + + {AF584111-FE32-448D-A1D0-63217AF8B43C} + chocolatey.resources + + + + @@ -352,4 +368,4 @@ --> - \ No newline at end of file + diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUnpackSelfCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUnpackSelfCommand.cs index f7f0cdb469..fba4ff0a5b 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUnpackSelfCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUnpackSelfCommand.cs @@ -1,13 +1,13 @@ // Copyright © 2017 Chocolatey Software, Inc // Copyright © 2011 - 2017 RealDimensions Software, LLC -// +// // 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. @@ -27,13 +27,20 @@ namespace chocolatey.infrastructure.app.commands using filesystem; using infrastructure.commands; using logging; +#if !NoResources using resources; +#endif [CommandFor("unpackself", "have chocolatey set itself up")] public class ChocolateyUnpackSelfCommand : ICommand { private readonly IFileSystem _fileSystem; + +#if !NoResources private Lazy _assemblyInitializer = new Lazy(() => Assembly.GetAssembly(typeof (ChocolateyResourcesAssembly))); +#else + private Lazy _assemblyInitializer = new Lazy(); +#endif [EditorBrowsable(EditorBrowsableState.Never)] public void initialize_with(Lazy assembly_initializer) @@ -67,11 +74,11 @@ public virtual void help_message(ChocolateyConfiguration configuration) { this.Log().Info(ChocolateyLoggers.Important, "UnpackSelf Command"); this.Log().Info(@" -This will unpack files needed by choco. It will overwrite existing +This will unpack files needed by choco. It will overwrite existing files only if --force is specified. -NOTE: This command should only be used when installing Chocolatey, not - during normal operation. +NOTE: This command should only be used when installing Chocolatey, not + during normal operation. "); @@ -114,4 +121,4 @@ public virtual bool may_require_admin_access() return true; } } -} \ No newline at end of file +}