public void IISWebPropertyLogInUTF8_Install() { string sourceFile = Path.Combine(IISWebPropertyTests.TestDataDirectory, @"product_LogInUTF8.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // get original value for the property bool originalEtagPropertyValue = (bool)IISVerifier.GetMetaBasePropertyValue("LogInUTF8"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify Etag property was set correctelly on install bool acctualEtagPropertyValue = (bool)IISVerifier.GetMetaBasePropertyValue("LogInUTF8"); bool expectedEtagPropertyValue = true; Assert.True(acctualEtagPropertyValue == expectedEtagPropertyValue, String.Format("LogInUTF8 Property value does not meat expected. Acctual: '{0}'. Expected: '{1}'.", acctualEtagPropertyValue, expectedEtagPropertyValue)); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify WebDir was removed acctualEtagPropertyValue = (bool)IISVerifier.GetMetaBasePropertyValue("LogInUTF8"); expectedEtagPropertyValue = originalEtagPropertyValue; Assert.True(acctualEtagPropertyValue == expectedEtagPropertyValue, String.Format("LogInUTF8 Property value does not meat expected. Acctual: '{0}'. Expected: '{1}'.", acctualEtagPropertyValue, expectedEtagPropertyValue)); }
public void IISWebPropertyEtag_Install() { string sourceFile = Path.Combine(IISWebPropertyTests.TestDataDirectory, @"product_etag.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // get original value for the property int originalEtagPropertyValue; if (!int.TryParse(IISVerifier.GetMetaBasePropertyValue("MD_ETAG_CHANGENUMBER").ToString(), out originalEtagPropertyValue)) { originalEtagPropertyValue = -1; // default is null } // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify Etag property was set correctelly on install int acctualEtagPropertyValue = (int)IISVerifier.GetMetaBasePropertyValue("MD_ETAG_CHANGENUMBER"); int expectedEtagPropertyValue = 1234; Assert.True(acctualEtagPropertyValue == expectedEtagPropertyValue, String.Format("Etag Property value does not meat expected. Acctual: '{0}'. Expected: '{1}'.", acctualEtagPropertyValue, expectedEtagPropertyValue)); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify WebDir was removed if (!int.TryParse(IISVerifier.GetMetaBasePropertyValue("MD_ETAG_CHANGENUMBER").ToString(), out acctualEtagPropertyValue)) { acctualEtagPropertyValue = -1; // default } expectedEtagPropertyValue = originalEtagPropertyValue; Assert.True(acctualEtagPropertyValue == expectedEtagPropertyValue, String.Format("Etag Property value does not meat expected. Acctual: '{0}'. Expected: '{1}'.", acctualEtagPropertyValue, expectedEtagPropertyValue)); }
public void IISWebDir_InstallFailure() { string sourceFile = Path.Combine(IISWebDirTests.TestDataDirectory, @"product_fail.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); // Verify WebDir was not created Assert.False(IISVerifier.WebDirExist("webdir", "Test web server"), String.Format("WebDir '{0}' in site '{1}' was created on failed install", "webdir", "Test web server")); }
public void IISWebAppPool_InstallFailure() { string sourceFile = Path.Combine(IISWebAppPoolTests.TestDataDirectory, @"product_fail.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", new string[] { "WixIIsExtension", "WixUtilExtension" }); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); // Verify that the app pool was removed Assert.IsFalse(IISVerifier.AppPoolExists("App Pool 1"), "AppPool '{0}' was not removed on Rollback", "App Pool 1"); }
public void IISVirtualDir_InstallFailure() { string sourceFile = Path.Combine(IISVirtualDirTests.TestDataDirectory, @"product_fail.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); // Verify that the Virtual directory was removed Assert.False(IISVerifier.VirtualDirExist("test1", "Test web server"), String.Format("VirtualDir '{0}' in site '{1}' was not removed on Rollback", "test1", "Test web server")); }
public void IISCertificate_InvalidCertificateFile_InstallFailure() { string sourceFile = Path.Combine(IISCertificateTests.TestDataDirectory, @"InvalidCertificateFile.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi string logFile = MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.ERROR_INSTALL_FAILURE); // Verify the log file for failure reason Assert.True(LogVerifier.MessageInLogFile(logFile, "Failed to read certificate from file path"), String.Format("Could not find fail message in log file: '{0}'.", logFile)); // Verify Machine certificate was not created Assert.False(IISVerifier.CertificateExists("TestCertPrivateKey", StoreLocation.LocalMachine), String.Format("Certificate '{0}' was not removed from the LocalMachine store on Rollback", "TestCertPrivateKey")); }
public void IISCertificate_CertificateRef_Install() { string sourceFile = Path.Combine(IISCertificateTests.TestDataDirectory, @"CertificateRef.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify Machine certificate was installed Assert.True(IISVerifier.CertificateExists("machinecert", StoreLocation.LocalMachine), String.Format("Certificate '{0}' was not created in the LocalMachine store on Install", "machinecert")); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify Machine certificate was removed Assert.False(IISVerifier.CertificateExists("machinecert", StoreLocation.LocalMachine), String.Format("Certificate '{0}' was not removed from the LocalMachine store on Uninstall", "machinecert")); }
public void IISWebDir_Install_64bit() { string sourceFile = Path.Combine(IISWebDirTests.TestDataDirectory, @"product_64.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify WebDir was created Assert.True(IISVerifier.WebDirExist("webdir", "Test web server"), String.Format("WebDir '{0}' in site '{1}' was not created on Install", "webdir", "Test web server")); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify WebDir was removed Assert.False(IISVerifier.WebDirExist("webdir", "Test web server"), String.Format("WebDir '{0}' in site '{1}' was not removed on Uninstall", "webdir", "Test web server")); }
public void IISWebSite_Install() { string sourceFile = Path.Combine(IISWebSiteTests.TestDataDirectory, @"product.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that the website was created and was started Assert.IsTrue(IISVerifier.WebSiteExists("Test web server"), "WebSite '{0}' was not created on Install", "Test web server"); Assert.IsTrue(IISVerifier.WebSiteStarted("Test web server"), "WebSite '{0}' was not started on Install", "Test web server"); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that the website was removed Assert.IsFalse(IISVerifier.WebSiteExists("Test web server"), "WebSite '{0}' was not removed on Uninstall", "Test web server"); }
public void IISFilter_Install() { string sourceFile = Path.Combine(IISFilterTests.TestDataDirectory, @"product.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify WebFilters were created Assert.True(IISVerifier.FilterExists("Test Filter", "Test web server", false), String.Format("Filter '{0}' in site '{1}' was not created on Install", "Test Filter", "Test web server")); Assert.True(IISVerifier.FilterExists("Global Filter", string.Empty, true), String.Format("Global Filter '{0}' was not created on Install", "Global Filter")); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify WebFilters were removed Assert.False(IISVerifier.FilterExists("Test Filter", "Test web server", false), String.Format("Filter '{0}' in site '{1}' was not removed on Uninstall", "Test Filter", "Test web server")); Assert.False(IISVerifier.FilterExists("Global Filter", string.Empty, true), String.Format("Global Filter '{0}' was not removed on Uninstall", "Global Filter")); }
public void IISVirtualDir_MultipleDirectories_Install() { string sourceFile = Path.Combine(IISVirtualDirTests.TestDataDirectory, @"MultipleDirectories.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that the Virtual directory for the web site was set correctly Assert.True(IISVerifier.VirtualDirExist("WebAppTest_Low", "Default Web Site"), String.Format("VirtualDir '{0}' in site '{1}' was not created on Install", "WebAppTest_Low", "Default Web Site")); Assert.True(IISVerifier.VirtualDirExist("WebAppTest_Medium", "Default Web Site"), String.Format("VirtualDir '{0}' in site '{1}' was not created on Install", "WebAppTest_Medium", "Default Web Site")); Assert.True(IISVerifier.VirtualDirExist("WebAppTest_High", "Default Web Site"), String.Format("VirtualDir '{0}' in site '{1}' was not created on Install", "WebAppTest_High", "Default Web Site")); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that the Virtual directory was removed Assert.False(IISVerifier.VirtualDirExist("WebAppTest_Low", "Default Web Site"), String.Format("VirtualDir '{0}' in site '{1}' was not removed on Uninstall", "WebAppTest_Low", "Default Web Site")); Assert.False(IISVerifier.VirtualDirExist("WebAppTest_Medium", "Default Web Site"), String.Format("VirtualDir '{0}' in site '{1}' was not removed on Uninstall", "WebAppTest_Medium", "Default Web Site")); Assert.False(IISVerifier.VirtualDirExist("WebAppTest_High", "Default Web Site"), String.Format("VirtualDir '{0}' in site '{1}' was not removed on Uninstall", "WebAppTest_High", "Default Web Site")); }
public void IISWebAppPool_Install() { string sourceFile = Path.Combine(IISWebAppPoolTests.TestDataDirectory, @"product.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", new string[] { "WixIIsExtension", "WixUtilExtension" }); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that the AppPool was created and verify its properties Assert.IsTrue(IISVerifier.AppPoolExists("App Pool 1"), "AppPool '{0}' was not created on Install", "App Pool 1"); long acctualApppoolQueueLength = IISVerifier.AppPoolQueueLength("App Pool 1"); Assert.IsTrue(acctualApppoolQueueLength == 4444, "AppPool '{0}' was not created on Install", "App Pool 1", acctualApppoolQueueLength, 4444); string acctualProcessIdentity = IISVerifier.AppPoolProcessIdentity("App Pool 1"); Assert.IsTrue(acctualProcessIdentity == "SpecificUser", "AppPool '{0}' ProcessingIdentity does not match expected. Acctual: '{1}'. Expected: '{2}'.", "App Pool 1", acctualProcessIdentity, "SpecificUser"); // Uninstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that the app pool was removed Assert.IsFalse(IISVerifier.AppPoolExists("App Pool 1"), "AppPool '{0}' was not removed on Uninstall", "App Pool 1"); }
public void IISWebServiceExtension_Install() { string sourceFile = Path.Combine(IISWebServiceExtensionTests.TestDataDirectory, @"product.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that Extension “extension1” is present in the WebSvcExtRestrictionList and is enabled Assert.True(IISVerifier.WebServiceExtensionExists("WiX Test Extension1"), String.Format("WebServiceExtension '{0}' was not created on Install", "WiX Test Extension1")); Assert.True(IISVerifier.WebServiceExtensionEnabled("WiX Test Extension1"), String.Format("WebServiceExtension '{0}' was not Enabled on Install", "WiX Test Extension1")); // Verify that Extension “extension2” is present in the WebSvcExtRestrictionList and is disabled Assert.True(IISVerifier.WebServiceExtensionExists("WiX Test Extension2"), String.Format("WebServiceExtension '{0}' was not created on Install", "WiX Test Extension2")); Assert.False(IISVerifier.WebServiceExtensionEnabled("WiX Test Extension2"), String.Format("WebServiceExtension '{0}' was not Disabled on Install", "WiX Test Extension2")); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that “WiX Test Extension1” and “WiX Test Extension2” were removed Assert.False(IISVerifier.WebServiceExtensionExists("WiX Test Extension1"), String.Format("WebServiceExtension '{0}' was not removed on Uninstall", "WiX Test Extension1")); Assert.False(IISVerifier.WebServiceExtensionExists("WiX Test Extension2"), String.Format("WebServiceExtension '{0}' was not removed on Uninstall", "WiX Test Extension2")); }
public void IISVirtualDir_Install() { string sourceFile = Path.Combine(IISVirtualDirTests.TestDataDirectory, @"product.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that the Virtual directory for the web site was set correctly Assert.True(IISVerifier.VirtualDirExist("test1", "Test web server"), String.Format("VirtualDir '{0}' in site '{1}' was not created on Install", "test1", "Test web server")); // Verify that the Application Name is set to 'Virtual Directory Test ASP Application' Assert.True(IISVerifier.WebApplicationExist("Virtual Directory Test ASP Application", "test1", "Test web server"), String.Format("WebApplication '{0}' in site '{1}' was not created on Install", "Virtual Directory Test ASP Application", "Test web server")); // Verify that the custom Http headers has an entry for 'VDirHttpHeader: Http Header For VDir' Assert.True(IISVerifier.CustomHeadderExist("VDirHttpHeader: Http Header For VDir", "test1", "Test web server"), String.Format("CustomHeadder '{0}' in site '{1}' was not created on Install", "VDirHttpHeader: Http Header For VDir", "Test web server")); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify that the Virtual directory was removed Assert.False(IISVerifier.VirtualDirExist("test1", "Test web server"), String.Format("VirtualDir '{0}' in site '{1}' was not removed on Uninstall", "test1", "Test web server")); }
public void IISCertificate_Install() { string sourceFile = Path.Combine(IISCertificateTests.TestDataDirectory, @"product.wxs"); string msiFile = Builder.BuildPackage(sourceFile, "test.msi", "WixIIsExtension"); // Install Msi MSIExec.InstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify Machine certificate was installed Assert.IsTrue(IISVerifier.CertificateExists("machinecert", StoreLocation.LocalMachine), "Certificate '{0}' was not created in the LocalMachine store on Install", "machinecert"); Assert.IsTrue(IISVerifier.CertificateExists("User", StoreLocation.CurrentUser), "Certificate '{0}' was not created in the CurrentUser store on Install", "machinecert"); Assert.IsTrue(IISVerifier.CertificateExists("machineCertFromBinary", StoreLocation.LocalMachine), "Certificate '{0}' was not created in the LocalMachine store on Install", "machineCertFromBinary"); Assert.IsTrue(IISVerifier.CertificateExists("TestCertPrivateKey", StoreLocation.LocalMachine), "Certificate '{0}' was not created in the LocalMachine store on Install", "TestCertPrivateKey"); // UnInstall Msi MSIExec.UninstallProduct(msiFile, MSIExec.MSIExecReturnCode.SUCCESS); // Verify Machine certificate was removed Assert.IsFalse(IISVerifier.CertificateExists("machinecert", StoreLocation.LocalMachine), "Certificate '{0}' was not removed from the LocalMachine store on Uninstall", "machinecert"); Assert.IsFalse(IISVerifier.CertificateExists("User", StoreLocation.CurrentUser), "Certificate '{0}' was not removed from the CurrentUser store on Uninstall", "machinecert"); Assert.IsFalse(IISVerifier.CertificateExists("machineCertFromBinary", StoreLocation.LocalMachine), "Certificate '{0}' was not removed from the LocalMachine store on Uninstall", "machineCertFromBinary"); Assert.IsFalse(IISVerifier.CertificateExists("TestCertPrivateKey", StoreLocation.LocalMachine), "Certificate '{0}' was not removed from the LocalMachine store on Uninstall", "TestCertPrivateKey"); }