Make the bundle to be uninstallable and fix MSI tests.

This commit is contained in:
Sridhar Periyasamy 2016-03-25 16:38:35 -07:00
parent ccef10b70c
commit 4186aca998
4 changed files with 9 additions and 23 deletions

View file

@ -8,9 +8,7 @@
<Bundle Name="$(var.ProductName)" Manufacturer="$(var.Manufacturer)"
Version="$(var.DisplayVersion)" UpgradeCode="$(var.UpgradeCode)"
AboutUrl="http://dotnet.github.io/"
Compressed="yes"
DisableModify="yes"
DisableRemove="yes">
Compressed="yes">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.Foundation">
<bal:WixStandardBootstrapperApplication
@ -34,13 +32,13 @@
<util:DirectorySearch Path="[PreviousInstallFolder]" Variable="DOTNETHOME" After="PreviousInstallFolderSearch" Condition="PreviousInstallFolder" />
<Chain DisableSystemRestore="yes" ParallelCache="yes">
<MsiPackage SourceFile="$(var.CLISDKMsiSourcePath)" Visible="yes">
<MsiPackage SourceFile="$(var.CLISDKMsiSourcePath)">
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
</MsiPackage>
<MsiPackage SourceFile="$(var.SharedFXMsiSourcePath)" Visible="yes">
<MsiPackage SourceFile="$(var.SharedFXMsiSourcePath)">
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
</MsiPackage>
<MsiPackage SourceFile="$(var.SharedHostMsiSourcePath)" Visible="yes">
<MsiPackage SourceFile="$(var.SharedHostMsiSourcePath)">
<MsiProperty Name="DOTNETHOME" Value="[DOTNETHOME]" />
</MsiPackage>
</Chain>

View file

@ -22,21 +22,16 @@ namespace Dotnet.Cli.Msi.Tests
_msiMgr = new MsiManager(msiFile);
}
[Theory]
[InlineData("")]
[InlineData(@"%SystemDrive%\dotnet")]
public void InstallTest(string installLocation)
[Fact]
public void InstallTest()
{
installLocation = Environment.ExpandEnvironmentVariables(installLocation);
string expectedInstallLocation = string.IsNullOrEmpty(installLocation) ?
Environment.ExpandEnvironmentVariables(@"%ProgramFiles%\dotnet") :
installLocation;
string expectedInstallLocation = Environment.ExpandEnvironmentVariables(@"%ProgramFiles%\dotnet");
// make sure that the msi is not already installed, if so the machine is in a bad state
Assert.False(_msiMgr.IsInstalled, "The dotnet CLI msi is already installed");
Assert.False(Directory.Exists(expectedInstallLocation));
_msiMgr.Install(installLocation);
_msiMgr.Install();
Assert.True(_msiMgr.IsInstalled);
Assert.True(Directory.Exists(expectedInstallLocation));

View file

@ -45,12 +45,5 @@ namespace Dotnet.Cli.Msi.Tests
Assert.Equal(_fixture.InstallLocation, regKey.GetValue("InstallDir"));
Assert.NotNull(regKey.GetValue("Version"));
}
[Fact]
public void UpgradeCodeTest()
{
// magic number found in https://github.com/dotnet/cli/blob/master/packaging/windows/variables.wxi
Assert.Equal("{7D73E4F7-71E2-4236-8CF5-1C499BA3FF50}", _msiMgr.UpgradeCode);
}
}
}

View file

@ -23,7 +23,7 @@ namespace Dotnet.Cli.Msi.Tests
Assert.False(Utils.ExistsOnPath("dotnet.exe"), "After uninstallation dotnet tools must not be on path");
}
[Fact]
[Fact(Skip = "https://github.com/dotnet/cli/issues/2073")]
public void DotnetRegKeysTest()
{
Assert.True(_msiMgr.IsInstalled);