Skip to content

Commit 0308984

Browse files
committed
Merge branch 'stable'
* stable: (chocolateyGH-1949) add default variable for msbuild.configuration (chocolateyGH-1949) switch assembly location on official key (maint) fix misspelling
2 parents 9a432ab + d5abb13 commit 0308984

File tree

4 files changed

+10
-6
lines changed

4 files changed

+10
-6
lines changed

.uppercut

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
<property name="app.strongname" value="C:${path.separator}Program Files${path.separator}Microsoft SDKs${path.separator}Windows${path.separator}v7.0A${path.separator}Bin${path.separator}sn.exe" />
5454
<property name="app.strongname" value="C:${path.separator}Program Files (x86)${path.separator}Microsoft SDKs${path.separator}Windows${path.separator}v7.0A${path.separator}Bin${path.separator}sn.exe" if="${not file::exists(app.strongname)}" />
5555

56+
<property name="msbuild.configuration" value="Release" overwrite="false" />
5657
<property name="path.key.name.private" value="${environment::get-variable('CHOCOLATEY_OFFICIAL_KEY')}" if="${environment::variable-exists('CHOCOLATEY_OFFICIAL_KEY') and msbuild.configuration == 'ReleaseOfficial'}" />
5758

5859
<property name="app.signtool" value="C:${path.separator}Program Files${path.separator}Microsoft SDKs${path.separator}Windows${path.separator}v7.0A${path.separator}Bin${path.separator}signtool.exe" />

build.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ SET BUILD_DIR=%~d0%~p0%
1313
SET NANT="%BUILD_DIR%lib\Nant\nant.exe"
1414
SET build.config.settings="%DIR%\.uppercut"
1515

16-
%NANT% /logger:"NAnt.Core.DefaultLogger" /quiet /nologo /f:"%BUILD_DIR%.build\default.build" -D:build.config.settings=%build.config.settings% -D:msbuild.configuration="Release" %*
16+
%NANT% /logger:"NAnt.Core.DefaultLogger" /quiet /nologo /f:"%BUILD_DIR%.build\default.build" -D:build.config.settings=%build.config.settings% %*
1717

1818
if %ERRORLEVEL% NEQ 0 goto errors
1919

src/chocolatey.console/Program.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private static void Main(string[] args)
101101
#endif
102102
if (args.Length == 0)
103103
{
104-
"chocolatley".Log().Info(ChocolateyLoggers.Important, () => "Please run 'choco -?' or 'choco <command> -?' for help menu.");
104+
"chocolatey".Log().Info(ChocolateyLoggers.Important, () => "Please run 'choco -?' or 'choco <command> -?' for help menu.");
105105
}
106106
}
107107

src/chocolatey/infrastructure.app/ApplicationParameters.cs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,16 @@ public static class ApplicationParameters
3030
private static readonly IFileSystem _fileSystem = new DotNetFileSystem();
3131
public static readonly string ChocolateyInstallEnvironmentVariableName = "ChocolateyInstall";
3232
public static readonly string Name = "Chocolatey";
33-
#if DEBUG
34-
public static readonly string InstallLocation = _fileSystem.get_directory_name(_fileSystem.get_current_assembly_path());
35-
public static readonly string LicensedAssemblyLocation = _fileSystem.file_exists(_fileSystem.combine_paths(InstallLocation, "chocolatey.licensed.dll")) ? _fileSystem.combine_paths(InstallLocation, "chocolatey.licensed.dll") : _fileSystem.combine_paths(InstallLocation, "extensions", "chocolatey", "chocolatey.licensed.dll");
3633

37-
#else
34+
#if FORCE_CHOCOLATEY_OFFICIAL_KEY
35+
// always look at the official location of the machine installation
3836
public static readonly string InstallLocation = System.Environment.GetEnvironmentVariable(ChocolateyInstallEnvironmentVariableName) ?? _fileSystem.get_directory_name(_fileSystem.get_current_assembly_path());
3937
public static readonly string LicensedAssemblyLocation = _fileSystem.combine_paths(InstallLocation, "extensions", "chocolatey", "chocolatey.licensed.dll");
38+
#else
39+
// Install location is choco.exe or chocolatey.dll
40+
public static readonly string InstallLocation = _fileSystem.get_directory_name(_fileSystem.get_current_assembly_path());
41+
// when being used as a reference, start by looking next to Chocolatey, then in a subfolder.
42+
public static readonly string LicensedAssemblyLocation = _fileSystem.file_exists(_fileSystem.combine_paths(InstallLocation, "chocolatey.licensed.dll")) ? _fileSystem.combine_paths(InstallLocation, "chocolatey.licensed.dll") : _fileSystem.combine_paths(InstallLocation, "extensions", "chocolatey", "chocolatey.licensed.dll");
4043
#endif
4144

4245
public static readonly string CommonAppDataChocolatey = _fileSystem.combine_paths(System.Environment.GetFolderPath(System.Environment.SpecialFolder.CommonApplicationData), Name);

0 commit comments

Comments
 (0)