Esempio n. 1
0
        public void DefaultOutput()
        {
            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.SetOutputFileIfNotSpecified = false;
            lit.OutputFile = string.Empty;
            lit.Run();
        }
Esempio n. 2
0
        public void NoSuppressWarningsSwitch()
        {
            Lit lit = new Lit();

            lit.OtherArguments = " -abc";
            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.ExpectedWixMessages.Add(new WixMessage(1098, "'abc' is not a valid command line argument.", WixMessage.MessageTypeEnum.Warning));
            lit.Run();
        }
Esempio n. 3
0
        public void MultipleWixObjFiles()
        {
            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.ObjectFiles.Add(Candle.Compile(Path.Combine(InputTests.TestDataDirectory, @"MultipleWixObjFiles\ComponentFragment.wxs")));
            lit.ObjectFiles.Add(Candle.Compile(Path.Combine(InputTests.TestDataDirectory, @"MultipleWixObjFiles\PropertyFragment.wxs")));
            lit.Run();
        }
Esempio n. 4
0
        public void SingleWixObjFile()
        {
            string testFile = Candle.Compile(WixTests.PropertyFragmentWxs);

            Lit lit = new Lit();

            lit.ObjectFiles.Add(testFile);
            lit.Run();
        }
        public void VerifyDeprecatedSwitch()
        {
            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.OtherArguments = "-wxall";
            lit.ExpectedWixMessages.Add(new WixMessage(1108, "The command line switch 'wxall' is deprecated. Please use 'wx' instead.", WixMessage.MessageTypeEnum.Warning));
            lit.Run();
        }
Esempio n. 6
0
        public void SuppressSpecificWarnings()
        {
            Lit lit = new Lit();

            lit.OtherArguments = " -abc";
            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.SuppressWarnings.Add(1098);
            lit.Run();
        }
Esempio n. 7
0
        public void SystemVariable()
        {
            string outputFile = Candle.Compile(Path.Combine(VariableTests.TestDataDirectory, @"SystemVariable\Product.wxs"));

            // The currentdirectory is returned without a \ in the end, modifying it to contain a \ as $(sys.CURRENTDIR) contains a \ in the end
            string expectedValue = String.Concat(Environment.CurrentDirectory, Path.DirectorySeparatorChar);

            Verifier.VerifyWixObjProperty(outputFile, "MyProperty", expectedValue);
        }
Esempio n. 8
0
        public void FileNameWithSpace()
        {
            DirectoryInfo outputDirectory = Directory.CreateDirectory(Utilities.FileUtilities.GetUniqueFileName());

            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.OutputFile = Path.Combine(outputDirectory.FullName, " Simple  Fragment                          .wix");
            lit.Run();
        }
Esempio n. 9
0
        public void SingleWxlFile()
        {
            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.LocFiles.Add(Path.Combine(LocalizationTests.TestDataDirectory, @"Shared\en-US.wxl"));
            lit.Run();

            Verifier.VerifyWixLibLocString(lit.OutputFile, "en-us", "String1", "String1(en-us)");
        }
Esempio n. 10
0
        public void NonAlphaNumericCharactersInFileName()
        {
            DirectoryInfo outputDirectory = Directory.CreateDirectory(Utilities.FileUtilities.GetUniqueFileName());

            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.OutputFile = Path.Combine(outputDirectory.FullName, "~!@#$%^&()_-+=,;.wix");
            lit.Run();
        }
        [Ignore] // ignored until we know the right behavior
        public void WxAndSw()
        {
            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.OtherArguments           = " -abc";
            lit.TreatAllWarningsAsErrors = true;
            lit.SuppressAllWarnings      = true;
            lit.Run();
        }
Esempio n. 12
0
        public void MultipleIncludeFiles()
        {
            string testFile = Path.Combine(IncludeFileTests.TestDataDirectory, @"MultipleIncludeFiles\Product.wxs");

            string outputFile = Candle.Compile(testFile);

            Verifier.VerifyWixObjProperty(outputFile, "MyProperty1", "foo");
            Verifier.VerifyWixObjProperty(outputFile, "MyProperty2", "bar");
            Verifier.VerifyWixObjProperty(outputFile, "MyProperty3", "baz");
        }
        public void TreatSpecificWarningsAsErrorSwitch()
        {
            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.OtherArguments = " -abc";
            lit.TreatWarningsAsErrors.Add(1098);
            lit.ExpectedWixMessages.Add(new WixMessage(1098, "'abc' is not a valid command line argument.", WixMessage.MessageTypeEnum.Error));
            lit.ExpectedExitCode = 1098;
            lit.Run();
        }
Esempio n. 14
0
        public void ResponseFile()
        {
            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.ResponseFile = Path.Combine(InputTests.TestDataDirectory, @"ResponseFile\ResponseFile.txt");
            lit.Run();

            // verify the loc file added by the @ResponseFile is read and added to the library
            Verifier.VerifyWixLibLocString(lit.OutputFile, "en-us", "String1", "String1(en-us)");
        }
Esempio n. 15
0
        public void LayoutDirectoryRefNonexistingId()
        {
            string candleOutput = Candle.Compile(Path.Combine(LayoutTests.TestDataDirectory, @"LayoutDirectoryRefNonexistingId\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(94, Message.MessageTypeEnum.Error)); //Unresolved reference to symbol error
            light.ExpectedExitCode = 94;
            light.Run();
        }
Esempio n. 16
0
        public void ReadOnlyInputFile()
        {
            string testFile = Candle.Compile(WixTests.PropertyFragmentWxs);

            // Set the file to readonly
            File.SetAttributes(testFile, FileAttributes.ReadOnly);

            Lit lit = new Lit();

            lit.ObjectFiles.Add(testFile);
            lit.Run();
        }
Esempio n. 17
0
        public void ForEach()
        {
            string testFile = Path.Combine(StatementTests.TestDataDirectory, @"ForEach\Product.wxs");

            string outputFile = Candle.Compile(testFile);

            for (int i = 1; i < 4; i++)
            {
                string expectedPropertyID = String.Concat("MyProperty", Convert.ToString(i));
                Verifier.VerifyWixObjProperty(outputFile, expectedPropertyID, Convert.ToString(i));
            }
        }
Esempio n. 18
0
        public void DuplicateLayoutDirectoryRef()
        {
            string candleOutput = Candle.Compile(Path.Combine(LayoutTests.TestDataDirectory, @"DuplicateLayoutDirectoryRef\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(130, "The primary key 'LayoutDirectory1/LayoutDirectory2' is duplicated in table 'WixLayoutDirRef'.  Please remove one of the entries or rename a part of the primary key to avoid the collision.", Message.MessageTypeEnum.Error)); //Unresolved reference to symbol error
            light.ExpectedExitCode = 130;
            light.Run();
        }
Esempio n. 19
0
        public void MissingPayloadGroupRef()
        {
            string candleOutput = Candle.Compile(Path.Combine(PayloadTests.TestDataDirectory, @"MissingPayloadGroupRef\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(94, Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 94;
            light.Run();
        }
Esempio n. 20
0
        public void PayloadInvalidSourceFile()
        {
            string candleOutput = Candle.Compile(Path.Combine(PayloadTests.TestDataDirectory, @"PayloadInvalidSourceFile\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(300, "Illegal characters in path 'Setup|*.exe'. Ensure you provided a valid path to the file.", Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 300;
            light.Run();
        }
Esempio n. 21
0
        public void PayloadNonexistentSourceFilePath()
        {
            string candleOutput = Candle.Compile(Path.Combine(PayloadTests.TestDataDirectory, @"PayloadNonexistentSourceFilePath\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(103, "The system cannot find the file 'NonExistentFileBootstrapper.exe' with type ''.", Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 103;
            light.Run();
        }
Esempio n. 22
0
        public void RecursiveLayoutDirectoryRef()
        {
            string candleOutput = Candle.Compile(Path.Combine(LayoutTests.TestDataDirectory, @"RecursiveLayoutDirectoryRef\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(332, @"A circular reference of layout directories was detected. The infinite loop includes: OutputDirectory1 and OutputDirectory2. layout directories references must form a directed acyclic graph.", Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 332;
            light.Run();
        }
Esempio n. 23
0
        public void DoubleQuotesInOutputFileName()
        {
            Lit lit = new Lit();

            lit.ObjectFiles.Add(Candle.Compile(WixTests.PropertyFragmentWxs));
            lit.OutputFile = "testfile\\\"wixobj";
            lit.SetOutputFileIfNotSpecified = false;
            string expectedOutput = string.Format("Your file or directory path '{0}' cannot contain a quote. Quotes are often accidentally introduced when trying to refer to a directory path with spaces in it, such as \"C:\\Out Directory\\\".  The correct representation for that path is: \"C:\\Out Directory\\\\\".", "testfile\"wixobj");

            lit.ExpectedWixMessages.Add(new WixMessage(117, expectedOutput, WixMessage.MessageTypeEnum.Error));
            lit.ExpectedExitCode = 117;
            lit.Run();
        }
Esempio n. 24
0
        public void PayloadGroupRecursiveRefs()
        {
            string candleOutput = Candle.Compile(Path.Combine(PayloadTests.TestDataDirectory, @"PayloadGroupRecursiveRefs\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(86, @"A circular reference of groups was detected. The infinite loop includes: PayloadGroup:PayloadGroup1 -> PayloadGroup:PayloadGroup2 -> PayloadGroup:PayloadGroup1. Group references must form a directed acyclic graph.", Message.MessageTypeEnum.Error));
            light.ExpectedExitCode      = 86;
            light.IgnoreWixMessageOrder = true;
            light.Run();
        }
Esempio n. 25
0
        public void PayloadGroupDuplicatePayloadGroupRefs()
        {
            string candleOutput = Candle.Compile(Path.Combine(PayloadTests.TestDataDirectory, @"PayloadGroupDuplicatePayloadGroupRefs\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(343, Message.MessageTypeEnum.Error)); // Circular reference error
            light.ExpectedExitCode      = 343;
            light.IgnoreWixMessageOrder = true;
            light.Run();
        }
Esempio n. 26
0
        public void PayloadGroupDuplicatePayloadInPayloadGroups()
        {
            string candleOutput = Candle.Compile(Path.Combine(PayloadTests.TestDataDirectory, @"PayloadGroupDuplicatePayloadInPayloadGroups\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(91, Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(92, Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 92;
            light.Run();
        }
        public void ChainDuplicatePackages()
        {
            string candleOutput = Candle.Compile(Path.Combine(ChainTests.TestDataDirectory, @"ChainDuplicatePackages\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(91, "Duplicate symbol 'ChainPackage:Package1' found.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(92, "Location of symbol related to previous error.", Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 92;
            light.Run();
        }
Esempio n. 28
0
        public void ReadOnlyInputFile()
        {
            // Retrieving the path to a temporary directory
            string testFile   = Path.Combine(Path.GetTempPath(), String.Concat(Path.GetTempFileName(), ".wxs"));
            string sourceFile = Path.Combine(WixTests.SharedAuthoringDirectory, "BasicProduct.wxs");

            File.Copy(sourceFile, testFile, true);

            // Set the file to readonly
            File.SetAttributes(testFile, FileAttributes.ReadOnly);

            Candle.Compile(testFile);
        }
Esempio n. 29
0
        public void DuplicateVariableName()
        {
            string candleOutput = Candle.Compile(Path.Combine(VariableTests.TestDataDirectory, @"DuplicateVariableName\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "Setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(91, "Duplicate symbol 'Variable:Variable1' found.", Message.MessageTypeEnum.Error));
            light.ExpectedWixMessages.Add(new WixMessage(92, "Location of symbol related to previous error.", Message.MessageTypeEnum.Error));
            light.ExpectedExitCode = 92;
            light.Run();
        }
        public void ChainDuplicatePackageGroupRefs()
        {
            string candleOutput = Candle.Compile(Path.Combine(ChainTests.TestDataDirectory, @"ChainDuplicatePackageGroupRefs\Product.wxs"));

            Light light = new Light();

            light.ObjectFiles.Add(candleOutput);
            light.OutputFile = "setup.exe";
            light.ExpectedWixMessages.Add(new WixMessage(343, Message.MessageTypeEnum.Error)); //A circular reference of ordering dependencies was detected.
            light.IgnoreWixMessageOrder = true;
            light.ExpectedExitCode      = 343;
            light.Run();
        }